Skip to content

Commit

Permalink
Move QPG summary printing to pipe_base.
Browse files Browse the repository at this point in the history
  • Loading branch information
TallJimbo committed Feb 6, 2025
1 parent abd086b commit 1ff8058
Showing 1 changed file with 9 additions and 28 deletions.
37 changes: 9 additions & 28 deletions python/lsst/ctrl/mpexec/cli/script/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

from astropy.table import Table
from lsst.daf.butler import Butler
from lsst.pipe.base import QuantumGraph, QuantumSuccessCaveats
from lsst.pipe.base import QuantumGraph
from lsst.pipe.base.execution_reports import QuantumGraphExecutionReport
from lsst.pipe.base.quantum_provenance_graph import QuantumProvenanceGraph, Summary

Expand Down Expand Up @@ -234,36 +234,17 @@ def print_summary(summary: Summary, full_output_filename: str | None, brief: boo
Parameters
----------
summary : `QuantumProvenanceGraph.Summary`
This `Pydantic` model contains all the information derived from the
`QuantumProvenanceGraph`.
This `Pydantic` model contains all the information derived from the
`QuantumProvenanceGraph`.
full_output_filename : `str | None`
Name of the JSON file in which to store summary information, if
passed.
Name of the JSON file in which to store summary information, if
passed.
brief : `bool`
Only display short (counts-only) summary on stdout. This includes
counts and not error messages or data_ids (similar to BPS report).
Only display short (counts-only) summary on stdout. This includes
counts and not error messages or data_ids (similar to BPS report).
Ignored (considered `False`) if ``full_output_filename`` is passed.
"""
summary.make_quantum_table().pprint_all()
print("")
print("Caveat codes:")
for k, v in QuantumSuccessCaveats.legend().items():
print(f"{k}: {v}")
print("")
if exception_table := summary.make_exception_table():
exception_table.pprint_all()
print("")
summary.make_dataset_table().pprint_all()
print("")
summary.pprint(brief=(brief or full_output_filename))
if full_output_filename:
with open(full_output_filename, "w") as stream:
stream.write(summary.model_dump_json(indent=2))
else:
if not brief:
for task_label, bad_quantum_table in summary.make_bad_quantum_tables().items():
print(f"{task_label} failures:")
bad_quantum_table.pprint_all()
print("")
for dataset_type_name, bad_dataset_table in summary.make_bad_dataset_tables().items():
print(f"{dataset_type_name} failures:")
bad_dataset_table.pprint_all()
print("")

0 comments on commit 1ff8058

Please sign in to comment.