Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
eigerx committed Jan 23, 2024
1 parent 2943a34 commit 3cc19ee
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
7 changes: 4 additions & 3 deletions python/lsst/ctrl/mpexec/cli/cmd/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,12 @@ def update_graph_run(
@click.command(cls=PipetaskCommand)
@repo_argument()
@ctrlMpExecOpts.qgraph_argument()
@click.option("--full-output-filename", default='', help="Summarize report in a yaml file")
@click.option("--full-output-filename", default="", help="Summarize report in a yaml file")
@click.option("--logs/--no-logs", default=True, help="Get butler log datasets for extra information.")
@click.option("--show-errors", default=False, help="Pretty-print a dict of errors from failed quanta.")
def report(repo: str, qgraph: str, full_output_filename: str = '', logs: bool = True,
show_errors: bool = False) -> None:
def report(
repo: str, qgraph: str, full_output_filename: str = "", logs: bool = True, show_errors: bool = False
) -> None:
"""Write a yaml file summarizing the produced and missing expected datasets
in a quantum graph.
Expand Down
27 changes: 15 additions & 12 deletions python/lsst/ctrl/mpexec/cli/script/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@
from lsst.pipe.base.execution_reports import QuantumGraphExecutionReport


def report(butler_config: str, qgraph_uri: str,
full_output_filename: str | None, logs: bool = True,
show_errors: bool = False) -> None:
def report(
butler_config: str,
qgraph_uri: str,
full_output_filename: str | None,
logs: bool = True,
show_errors: bool = False,
) -> None:
"""Summarize the produced and missing expected dataset in a quantum graph.
Parameters
Expand All @@ -59,12 +63,6 @@ def report(butler_config: str, qgraph_uri: str,
command-line along with the report. By default, these messages and
their associated data ids are stored in a yaml file with format
`{run timestamp}_err.yaml` in the working directory instead.
See Also
--------
lsst.pipe.base.QuantumGraphExecutionReport.make_reports
lsst.pipe.base.QuantumGraphExecutionReport.write_summary_yaml
lsst.pipe.base.TaskExecutionReport.to_summary_dict
"""
butler = Butler.from_config(butler_config, writeable=False)
qgraph = QuantumGraph.loadUri(qgraph_uri)
Expand All @@ -81,10 +79,15 @@ def report(butler_config: str, qgraph_uri: str,
dataset_table_rows.append(summary_dict[task]["outputs"][data_product])
data_products.append(data_product)

Check warning on line 80 in python/lsst/ctrl/mpexec/cli/script/report.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/ctrl/mpexec/cli/script/report.py#L79-L80

Added lines #L79 - L80 were not covered by tests

quanta_summary.append({"Task" : task, "Failed Quanta" : summary_dict[task]["failed_quanta"],
"Blocked Quanta": summary_dict[task]["n_quanta_blocked"]})
quanta_summary.append(

Check warning on line 82 in python/lsst/ctrl/mpexec/cli/script/report.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/ctrl/mpexec/cli/script/report.py#L82

Added line #L82 was not covered by tests
{
"Task": task,
"Failed Quanta": summary_dict[task]["failed_quanta"],
"Blocked Quanta": summary_dict[task]["n_quanta_blocked"],
}
)

if 'errors' in summary_dict[task].keys():
if "errors" in summary_dict[task].keys():
error_summary.append({task: summary_dict[task]["errors"]})
quanta = Table(quanta_summary)
datasets = Table(dataset_table_rows)
Expand Down

0 comments on commit 3cc19ee

Please sign in to comment.