Skip to content

Commit

Permalink
Make butler a required argument
Browse files Browse the repository at this point in the history
  • Loading branch information
eigerx committed Oct 31, 2023
1 parent 7cfdde6 commit 09703a7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions python/lsst/ctrl/mpexec/cli/cmd/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,16 +327,18 @@ def update_graph_run(


@click.command(cls=PipetaskCommand)
@repo_argument()
@ctrlMpExecOpts.qgraph_argument()
@ctrlMpExecOpts.butler_config_option()
@click.argument("output_yaml", type=click.Path(exists=False))
@click.option("--logs/--no-logs", default=True, help="Get butler log datasets for extra information.")
def report(qgraph: str, butler_config: str, output_yaml: str, logs: bool = True) -> None:
def report(repo: str, qgraph: str, output_yaml: str, logs: bool = True) -> None:
"""Write a yaml file summarizing the produced and missing expected datasets
in a quantum graph.
REPO is the location of the butler/registry config file.
QGRAPH is the URL to a serialized Quantum Graph file.
OUTPUT_YAML is the URL to store the summary report.
"""
script.report(qgraph, butler_config, output_yaml, logs)
script.report(repo, qgraph, output_yaml, logs)
4 changes: 2 additions & 2 deletions python/lsst/ctrl/mpexec/cli/script/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from lsst.pipe.base.execution_reports import QuantumGraphExecutionReport


def report(qgraph_uri: str, butler_config: str, output_yaml: str, logs: bool = True) -> None:
def report(butler_config: str, qgraph_uri: str, output_yaml: str, logs: bool = True) -> None:
"""Write a yaml file summarizing the produced and missing expected datasets
in a quantum graph.
Expand All @@ -51,7 +51,7 @@ def report(qgraph_uri: str, butler_config: str, output_yaml: str, logs: bool = T
lsst.pipe.base.QuantumGraphExecutionReport.make_reports
lsst.pipe.base.QuantumGraphExecutionReport.write_summary_yaml
"""
qgraph = QuantumGraph.loadUri(qgraph_uri)
butler = Butler(butler_config)
qgraph = QuantumGraph.loadUri(qgraph_uri)
report = QuantumGraphExecutionReport.make_reports(butler, qgraph)
report.write_summary_yaml(butler, output_yaml, logs=logs)
2 changes: 1 addition & 1 deletion tests/test_cliCmdReport.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def test_report(self):

result = self.runner.invoke(
pipetask_cli,
["report", graph_uri, "-b", self.root, test_filename, "--no-logs"],
["report", self.root, graph_uri, test_filename, "--no-logs"],
input="no",
)

Expand Down

0 comments on commit 09703a7

Please sign in to comment.