Skip to content

Commit

Permalink
Use butler collections and where options
Browse files Browse the repository at this point in the history
  • Loading branch information
eigerx committed Sep 12, 2024
1 parent b940c44 commit 34deca4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
21 changes: 11 additions & 10 deletions python/lsst/ctrl/mpexec/cli/cmd/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@
from lsst.ctrl.mpexec import Report
from lsst.ctrl.mpexec.showInfo import ShowInfo
from lsst.daf.butler.cli.opt import (
collections_option,
config_file_option,
config_option,
confirm_option,
options_file_option,
processes_option,
repo_argument,
where_option,
)
from lsst.daf.butler.cli.utils import MWCtxObj, catch_and_exit, option_section, unwrap

Expand Down Expand Up @@ -342,13 +344,8 @@ def update_graph_run(
@click.command(cls=PipetaskCommand)
@repo_argument()
@click.argument("qgraphs", nargs=-1)
@click.option(
"--collections",
default=None,
help="Collection(s) associated with said graphs/processing."
" For use in `lsst.daf.butler.registry.queryDatasets` if paring down the query would be useful.",
)
@click.option("--where", default="", help="A 'where' string to use to constrain the collections, if passed.")
@collections_option()
@where_option()
@click.option(
"--full-output-filename",
default="",
Expand Down Expand Up @@ -381,7 +378,7 @@ def update_graph_run(
def report(
repo: str,
qgraphs: Sequence[str],
collections: Sequence[str] | None,
collections_sequence: Sequence[str] | None,
where: str,
full_output_filename: str = "",
logs: bool = True,
Expand All @@ -399,14 +396,18 @@ def report(
(default). If the terminal is overwhelmed with data_ids from failures try
the `--brief` option.
Butler `collections` and `where` options are for use in
`lsst.daf.butler.queryDatasets` if paring down the collections would be
useful. By default the collections and query will match the graphs.
REPO is the location of the butler/registry config file.
QGRAPHS is a Sequence of links to serialized Quantum Graphs which have been
executed and are to be analyzed.
"""
if force_v2 or len(qgraphs) > 1 or collections is not None:
if force_v2 or len(qgraphs) > 1 or collections_sequence is not None:
script.report_v2(
repo, qgraphs, collections, where, full_output_filename, logs, brief, curse_failed_logs
repo, qgraphs, collections_sequence, where, full_output_filename, logs, brief, curse_failed_logs
)
else:
assert len(qgraphs) == 1, "Cannot make a report without a quantum graph."
Expand Down
1 change: 1 addition & 0 deletions tests/test_cliCmdReport.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def test_report(self):
["report", self.root, graph_uri, "--no-logs", "--brief"],
input="no",
)
breakpoint()
self.assertIsInstance(result_brief.stdout, str)

# Check that task0 and the failed quanta for task0 exist in the string
Expand Down

0 comments on commit 34deca4

Please sign in to comment.