Skip to content

Commit cde86df

Browse files
committed
Some docstring fixes
1 parent c5b6c6a commit cde86df

8 files changed

Lines changed: 66 additions & 53 deletions

File tree

doc/lsst.ctrl.mpexec/CHANGES.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ API Changes
274274
* New class ``PreExecInitLimited`` which performs pre-exec-init in case of Quantum-backed butler.
275275
The code that it shares with a regular ``PreExecInit`` class is now in their common base class ``PreExecInitBase``. (`DM-33497 <https://rubinobs.atlassian.net/browse/DM-33497>`_)
276276
- Added new ``resources`` parameter to ``SingleQuantumExecutor``, ``SimplePipelineExecutor``, and ``SeparablePipelineExecutor`` constructors.
277-
This optional parameter is a `~lsst.pipe.base.ExecutionResources` object and allows the execution context to be passed into the `~lsst.pipe.base.PipelinesTask.runQuantum` method. (`DM-39661 <https://rubinobs.atlassian.net/browse/DM-39661>`_)
277+
This optional parameter is a `~lsst.pipe.base.ExecutionResources` object and allows the execution context to be passed into the `~lsst.pipe.base.PipelineTask.runQuantum` method. (`DM-39661 <https://rubinobs.atlassian.net/browse/DM-39661>`_)
278278

279279

280280
Bug Fixes
@@ -294,7 +294,7 @@ Other Changes and Additions
294294
Previously this did not matter (the graph run was being ignored) but with the change to always use the ``DatasetRef`` from the graph it becomes critical that they match. (`DM-38779 <https://rubinobs.atlassian.net/browse/DM-38779>`_)
295295
- Revive the previously-bitrotted pipeline mocking system.
296296

297-
Most of the implementation has been moved to `pipe_base`, and the point at which mocking occurs has moved from execution to just before `QuantumGraph` generation, which changes which `pipetask` subcommands the `--mock` option is valid for. (`DM-38952 <https://rubinobs.atlassian.net/browse/DM-38952>`_)
297+
Most of the implementation has been moved to ``pipe_base``, and the point at which mocking occurs has moved from execution to just before ``QuantumGraph`` generation, which changes which ``pipetask`` subcommands the ``--mock`` option is valid for. (`DM-38952 <https://rubinobs.atlassian.net/browse/DM-38952>`_)
298298
- Updated the directed graph color scheme with an aim towards making node text easier to read.
299299
The previous pipeline directed graph nodes used dark gray as their background color.
300300
It had been reported that it is difficult to read the black text on the dark gray background.

python/lsst/ctrl/mpexec/cli/butler_factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ def make_butler_and_collections(
393393
butler : `lsst.daf.butler.Butler`
394394
A read-only butler that collections will be added to and/or queried
395395
from.
396-
inputs : `Sequence` [ `str` ]
396+
inputs : `~collections.abc.Sequence` [ `str` ]
397397
Collections to search for datasets.
398398
run : `str` or `None`
399399
Name of the output `~lsst.daf.butler.CollectionType.RUN` collection

python/lsst/ctrl/mpexec/cli/cmd/commands.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ def update_graph_run(
357357
is_flag=True,
358358
default=False,
359359
help="Use the QuantumProvenanceGraph instead of the QuantumGraphExecutionReport, "
360-
"even when there is only one qgraph. Otherwise, the `QuantumGraphExecutionReport` "
360+
"even when there is only one qgraph. Otherwise, the QuantumGraphExecutionReport "
361361
"will run on one graph by default.",
362362
)
363363
@click.option(
@@ -400,18 +400,18 @@ def report(
400400
recoveries and persistent failures. Identify mismatch errors between
401401
attempts.
402402
403-
Save the report as a file (`--full-output-filename`) or print it to stdout
404-
(default). If the terminal is overwhelmed with data_ids from failures try
405-
the `--brief` option.
403+
Save the report as a file (``--full-output-filename``) or print it to
404+
stdout (default). If the terminal is overwhelmed with data_ids from
405+
failures try the ``--brief`` option.
406406
407-
Butler `collections` and `where` options are for use in
408-
`lsst.daf.butler.queryDatasets` if paring down the collections would be
409-
useful. Pass collections in order of most to least recent. By default the
410-
collections and query will be taken from the graphs.
407+
Butler ``collections`` and ``where`` options are for use in
408+
`lsst.daf.butler.Registry.queryDatasets` if paring down the collections
409+
would be useful. Pass collections in order of most to least recent. By
410+
default the collections and query will be taken from the graphs.
411411
412412
REPO is the location of the butler/registry config file.
413413
414-
QGRAPHS is a `Sequence` of links to serialized Quantum Graphs which have
414+
QGRAPHS is a sequence of links to serialized Quantum Graphs which have
415415
been executed and are to be analyzed. Pass the graphs in order of first to
416416
last executed.
417417
"""
@@ -456,12 +456,13 @@ def aggregate_reports(
456456
Summary over common tasks and datasets. Intended for use when the same
457457
pipeline has been run over all groups (i.e., to aggregate all reports
458458
for a given step). This functionality is only compatible with reports
459-
from the `QuantumProvenanceGraph`, so the reports must be run over multiple
460-
groups or with the `--force-v2` option.
459+
from the `~lsst.pipe.base.quantum_provenance_graph.QuantumProvenanceGraph`,
460+
so the reports must be run over multiple groups or with the ``--force-v2``
461+
option.
461462
462-
Save the report as a file (`--full-output-filename`) or print it to stdout
463-
(default). If the terminal is overwhelmed with data_ids from failures try
464-
the `--brief` option.
463+
Save the report as a file (``--full-output-filename``) or print it to
464+
stdout (default). If the terminal is overwhelmed with data_ids from
465+
failures try the ``--brief`` option.
465466
466467
FILENAMES are the space-separated paths to json file output created by
467468
pipetask report.

python/lsst/ctrl/mpexec/cli/script/qgraph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def qgraph(
100100
----------
101101
pipeline_graph_factory : `..PipelineGraphFactory` or `None`
102102
A factory that holds the pipeline and can produce a pipeline graph.
103-
If this is not `None` then `qgraph` should be `None`.
103+
If this is not `None` then ``qgraph`` should be `None`.
104104
qgraph : convertible to `lsst.resources.ResourcePath`, or `None`
105105
URI location for a serialized quantum graph definition. If this option
106106
is not `None` then ``pipeline_graph_factory`` should be `None`.

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

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def report(
4545
) -> None:
4646
"""Summarize the produced, missing and expected quanta and
4747
datasets belonging to an executed quantum graph using the
48-
`QuantumGraphExecutionReport`.
48+
`lsst.pipe.base.execution_reports.QuantumGraphExecutionReport`.
4949
5050
Parameters
5151
----------
@@ -141,16 +141,17 @@ def report_v2(
141141
butler_config : `str`
142142
The Butler used for this report. This should match the Butler used for
143143
the run associated with the executed quantum graph.
144-
qgraph_uris : `Sequence` [`str`]
144+
qgraph_uris : `~collections.abc.Sequence` [`str`]
145145
One or more uris to the serialized Quantum Graph(s).
146-
collections : `Sequence` [`str`] | None`
146+
collections : `~collections.abc.Sequence` [`str`] | `None`
147147
Collection(s) associated with said graphs/processing. For use in
148-
`lsst.daf.butler.registry.queryDatasets` if paring down the query would
148+
`lsst.daf.butler.Registry.queryDatasets` if paring down the query would
149149
be useful.
150150
where : `str`
151151
A "where" string to use to constrain the collections, if passed.
152152
full_output_filename : `str`
153-
Output the full pydantic model `QuantumProvenanceGraph.Summary` object
153+
Output the full pydantic model
154+
`lsst.pipe.base.quantum_provenance_graph.Summary` object
154155
into a JSON file. This is ideal for error-matching and cataloguing
155156
tools such as the ones used by Campaign Management software and pilots,
156157
and for searching and counting specific kinds or instances of failures.
@@ -184,7 +185,8 @@ def report_v2(
184185
n_cores : `int`, optional
185186
Number of cores for metadata and log reads.
186187
view_graph : `bool`
187-
Display a graph representation of `QuantumProvenanceGraph.Summary` on
188+
Display a graph representation of
189+
`lsst.pipe.base.quantum_provenance_graph.Summary` on
188190
stdout instead of the default plain-text summary. Pipeline graph nodes
189191
are then annotated with their status. This is a useful way to visualize
190192
the flow of quanta and datasets through the graph and to identify where
@@ -235,25 +237,29 @@ def report_v2(
235237
def aggregate_reports(
236238
filenames: Sequence[str], full_output_filename: str | None, brief: bool = False
237239
) -> None:
238-
"""Aggregrate multiple `QuantumProvenanceGraph` summaries on separate
239-
dataquery-identified groups into one wholistic report. This is intended for
240-
reports over the same tasks in the same pipeline, after `pipetask report`
241-
has been resolved over all graphs associated with each group.
240+
"""Aggregrate multiple
241+
`lsst.pipe.base.quantum_provenance_graph.QuantumProvenanceGraph` summaries
242+
on separate dataquery-identified groups into one wholistic report.
243+
244+
This is intended for reports over the same tasks in the same pipeline,
245+
after ``pipetask report`` has been resolved over all graphs associated with
246+
each group.
242247
243248
Parameters
244249
----------
245-
filenames : `Sequence[str]`
246-
The paths to the JSON files produced by `pipetask report` (note: this
247-
is only compatible with the multi-graph or `--force-v2` option). These
248-
files correspond to the `QuantumProvenanceGraph.Summary` objects which
249-
are produced for each group.
250-
full_output_filename : `str | None`
250+
filenames : `~collections.abc.Sequence` [`str`]
251+
The paths to the JSON files produced by ``pipetask report`` (note: this
252+
is only compatible with the multi-graph or ``--force-v2`` option).
253+
These files correspond to the
254+
`lsst.pipe.base.quantum_provenance_graph.Summary` objects
255+
which are produced for each group.
256+
full_output_filename : `str` | `None`
251257
The name of the JSON file in which to store the aggregate report, if
252258
passed. This is passed to `print_summary` at the end of this function.
253-
brief : `bool = False`
259+
brief : `bool`, optional
254260
Only display short (counts-only) summary on stdout. This includes
255261
counts and not error messages or data_ids (similar to BPS report).
256-
This option will still report all `cursed` datasets and `wonky`
262+
This option will still report all ``cursed`` datasets and ``wonky``
257263
quanta. This is passed to `print_summary` at the end of this function.
258264
"""
259265
summaries: list[Summary] = []
@@ -266,15 +272,15 @@ def aggregate_reports(
266272

267273

268274
def print_summary(summary: Summary, full_output_filename: str | None, brief: bool = False) -> None:
269-
"""Take a `QuantumProvenanceGraph.Summary` object and write it to a file
270-
and/or the screen.
275+
"""Take a `lsst.pipe.base.quantum_provenance_graph.Summary` object and
276+
write it to a file and/or the screen.
271277
272278
Parameters
273279
----------
274-
summary : `QuantumProvenanceGraph.Summary`
280+
summary : `lsst.pipe.base.quantum_provenance_graph.Summary`
275281
This `Pydantic` model contains all the information derived from the
276-
`QuantumProvenanceGraph`.
277-
full_output_filename : `str | None`
282+
`lsst.pipe.base.quantum_provenance_graphQuantumProvenanceGraph`.
283+
full_output_filename : `str` | `None`
278284
Name of the JSON file in which to store summary information, if
279285
passed.
280286
brief : `bool`

python/lsst/ctrl/mpexec/mpGraphExecutor.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ class MPGraphExecutor(lsst.pipe.base.mp_graph_executor.MPGraphExecutor):
4949
"""Implementation of QuantumGraphExecutor using same-host multiprocess
5050
execution of Quanta.
5151
52-
This is a deprecated backwards-compatibility shim for
53-
`lsst.pipe.base.mp_graph_executor.MPGraphExecutor`, which has
54-
the same functionality with very minor interface changes.
55-
5652
Parameters
5753
----------
5854
numProc : `int`
@@ -74,6 +70,13 @@ class MPGraphExecutor(lsst.pipe.base.mp_graph_executor.MPGraphExecutor):
7470
`lsst.pipe.base.execution_graph_fixup.ExecutionGraphFixup`, \
7571
optional
7672
Instance used for modification of execution graph.
73+
74+
Notes
75+
-----
76+
This is a deprecated backwards-compatibility shim for
77+
`lsst.pipe.base.mp_graph_executor.MPGraphExecutor`, which has
78+
the same functionality with very minor interface changes.
79+
7780
"""
7881

7982
def __init__(

python/lsst/ctrl/mpexec/preExecInit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
from __future__ import annotations
2929

30-
__all__ = ["PreExecInit"]
30+
__all__ = ["PreExecInit", "PreExecInitBase"]
3131

3232
# -------------------------------
3333
# Imports of standard modules --
@@ -157,7 +157,7 @@ def saveConfigs(self, graph: QuantumGraph) -> None:
157157
158158
Raises
159159
------
160-
ConflictingDefinitionError
160+
lsst.daf.butler.registry.ConflictingDefinitionError
161161
Raised if existing object in butler is different from new data, or
162162
if ``extendRun`` is `False` and datasets already exists.
163163
Content of a butler collection should not be changed if this

python/lsst/ctrl/mpexec/singleQuantumExecutor.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@
5454
class SingleQuantumExecutor(lsst.pipe.base.single_quantum_executor.SingleQuantumExecutor):
5555
"""Executor class which runs one Quantum at a time.
5656
57-
This is a deprecated backwards-compatibility shim for
58-
`lsst.pipe.base.single_quantum_executor.SingleQuantumExecutor`, which has
59-
the same functionality with very minor interface changes.
60-
6157
Parameters
6258
----------
6359
butler : `~lsst.daf.butler.Butler` or `None`
@@ -79,7 +75,7 @@ class SingleQuantumExecutor(lsst.pipe.base.single_quantum_executor.SingleQuantum
7975
a quantum will be removed. Only used when ``butler`` is not `None`.
8076
enableLsstDebug : `bool`, optional
8177
Enable debugging with ``lsstDebug`` facility for a task.
82-
limited_butler_factory : `Callable`, optional
78+
limited_butler_factory : `~collections.abc.Callable`, optional
8379
A method that creates a `~lsst.daf.butler.LimitedButler` instance for a
8480
given Quantum. This parameter must be defined if ``butler`` is `None`.
8581
If ``butler`` is not `None` then this parameter is ignored.
@@ -98,14 +94,21 @@ class SingleQuantumExecutor(lsst.pipe.base.single_quantum_executor.SingleQuantum
9894
of those to `False`, it also avoids all dataset existence checks.
9995
raise_on_partial_outputs : `bool`, optional
10096
If `True` raise exceptions chained by
101-
`lsst.pipe.base.AnnotatedPartialOutputError` immediately, instead of
97+
`lsst.pipe.base.AnnotatedPartialOutputsError` immediately, instead of
10298
considering the partial result a success and continuing to run
10399
downstream tasks.
104100
job_metadata : `~collections.abc.Mapping`
105101
Mapping with extra metadata to embed within the quantum metadata under
106102
the "job" key. This is intended to correspond to information common
107103
to all quanta being executed in a single process, such as the time
108104
taken to load the quantum graph in a BPS job.
105+
106+
Notes
107+
-----
108+
This is a deprecated backwards-compatibility shim for
109+
`lsst.pipe.base.single_quantum_executor.SingleQuantumExecutor`, which has
110+
the same functionality with very minor interface changes.
111+
109112
"""
110113

111114
def __init__(

0 commit comments

Comments
 (0)