From a6c4f8d4839076dc73e7a71b48869be72209ecb0 Mon Sep 17 00:00:00 2001 From: Orion Eiger Date: Thu, 27 Jun 2024 15:57:39 -0700 Subject: [PATCH] Fix argument and init for v2 --- python/lsst/ctrl/mpexec/cli/cmd/commands.py | 5 +++-- python/lsst/ctrl/mpexec/cli/script/__init__.py | 2 +- python/lsst/ctrl/mpexec/cli/script/report.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/python/lsst/ctrl/mpexec/cli/cmd/commands.py b/python/lsst/ctrl/mpexec/cli/cmd/commands.py index 0f648a7c..7767310a 100644 --- a/python/lsst/ctrl/mpexec/cli/cmd/commands.py +++ b/python/lsst/ctrl/mpexec/cli/cmd/commands.py @@ -340,7 +340,7 @@ def update_graph_run( @click.command(cls=PipetaskCommand) @repo_argument() -@click.argument() +@click.argument("qgraphs", nargs=-1) @click.option("--collections", default=None, help="Collections to resolve duplicate datasets in.") @click.option("--where", default="", help="where") @click.option("--full-output-filename", default="", help="Output report as a yaml file with this name.") @@ -389,4 +389,5 @@ def report( repo, qgraphs, collections, where, full_output_filename, logs, show_errors, curse_failed_logs ) else: - script.report(repo, qgraphs, full_output_filename, logs, show_errors) + assert(len(qgraphs) == 1, "Cannot make a report without a quantum graph.") + script.report(repo, qgraphs[0], full_output_filename, logs, show_errors) diff --git a/python/lsst/ctrl/mpexec/cli/script/__init__.py b/python/lsst/ctrl/mpexec/cli/script/__init__.py index 10767d14..dc14543e 100644 --- a/python/lsst/ctrl/mpexec/cli/script/__init__.py +++ b/python/lsst/ctrl/mpexec/cli/script/__init__.py @@ -31,7 +31,7 @@ from .pre_exec_init_qbb import pre_exec_init_qbb from .purge import PurgeResult, purge from .qgraph import qgraph -from .report import report +from .report import report, report_v2 from .run import run from .run_qbb import run_qbb from .update_graph_run import update_graph_run diff --git a/python/lsst/ctrl/mpexec/cli/script/report.py b/python/lsst/ctrl/mpexec/cli/script/report.py index 9e2c0675..9ada10d6 100644 --- a/python/lsst/ctrl/mpexec/cli/script/report.py +++ b/python/lsst/ctrl/mpexec/cli/script/report.py @@ -143,7 +143,7 @@ def report_v2( qpg.resolve_duplicates(butler, collections=collections, where=where, curse_failed_logs=curse_failed_logs) summary = qpg.to_summary(butler, do_store_logs=logs) summary_dict = summary.model_dump() - if full_output_filename is not None: + if full_output_filename: with open(full_output_filename, "w") as stream: yaml.safe_dump(summary_dict, stream) elif not full_output_filename: