SingleQuantumExecutor¶
- class lsst.pipe.base.single_quantum_executor.SingleQuantumExecutor(*, butler: Butler | None = None, task_factory: TaskFactory | None = None, skip_existing_in: Any = None, clobber_outputs: bool = False, enable_lsst_debug: bool = False, limited_butler_factory: Callable[[Quantum], LimitedButler] | None = None, resources: ExecutionResources | None = None, skip_existing: bool = False, assume_no_existing_outputs: bool = False, raise_on_partial_outputs: bool = True, job_metadata: Mapping[str, int | str | float] | None = None)¶
Bases:
QuantumExecutor
Executor class which runs one Quantum at a time.
- Parameters:
- butler
Butler
orNone
, optional Data butler,
None
means that a limited butler should be used instead.- task_factory
TaskFactory
, optional Instance of a task factory. Defaults to a new instance of
lsst.pipe.base.TaskFactory
.- skip_existing_in
str
orIterable
[str
] Expressions representing the collections to search for existing output datasets. See Ordered collection searches for allowed types. This class only checks for the presence of butler output run in the list of collections. If the output run is present in the list then the quanta whose complete outputs exist in the output run will be skipped.
None
or empty string/sequence disables skipping.- clobber_outputs
bool
, optional If
True
, then outputs from a quantum that exist in output run collection will be removed prior to executing a quantum. Ifskip_existing_in
contains output run, then only partial outputs from a quantum will be removed. Only used whenbutler
is notNone
.- enable_lsst_debug
bool
, optional Enable debugging with
lsstDebug
facility for a task.- limited_butler_factory
Callable
, optional A method that creates a
LimitedButler
instance for a given Quantum. This parameter must be defined ifbutler
isNone
. Ifbutler
is notNone
then this parameter is ignored.- resources
ExecutionResources
, optional The resources available to this quantum when executing.
- skip_existing
bool
, optional If
True
, skip quanta whose metadata datasets are already stored. Unlikeskip_existing_in
, this works with limited butlers as well as full butlers. Always set toTrue
ifskip_existing_in
matchesbutler.run
.- assume_no_existing_outputs
bool
, optional If
True
, assume preexisting outputs are impossible (e.g. because this is known by higher-level code to be a newRUN
collection), and do not look for them. This causes theskip_existing
andclobber_outputs
options to be ignored, but unlike just setting both of those toFalse
, it also avoids all dataset existence checks.- raise_on_partial_outputs
bool
, optional If
True
raise exceptions chained byAnnotatedPartialOutputsError
immediately, instead of considering the partial result a success and continuing to run downstream tasks.- job_metadata
Mapping
Mapping with extra metadata to embed within the quantum metadata under the “job” key. This is intended to correspond to information common to all quanta being executed in a single process, such as the time taken to load the quantum graph in a BPS job.
- butler
Methods Summary
execute
(task_node, /, quantum[, quantum_id])Execute single quantum.
Methods Documentation
- execute(task_node: TaskNode, /, quantum: Quantum, quantum_id: UUID | None = None) tuple[lsst.daf.butler._quantum.Quantum, lsst.pipe.base.quantum_reports.QuantumReport | None] ¶
Execute single quantum.
- Parameters:
- Returns:
- quantum
Quantum
The quantum actually executed.
- report
QuantumReport
Structure describing the status of the execution of a quantum.
None
is returned if implementation does not support this feature.
- quantum
Notes
Any exception raised by the task or code that wraps task execution is propagated to the caller of this method.