Quantum

class lsst.daf.butler.Quantum(*, taskName=None, taskClass=None, dataId=None, run=None, initInputs=None, predictedInputs=(), actualInputs=(), outputs=(), startTime=None, endTime=None, host=None, id=None, **kwargs)

Bases: object

A discrete unit of work that may depend on one or more datasets and produces one or more datasets.

Most Quanta will be executions of a particular PipelineTask’s runQuantum method, but they can also be used to represent discrete units of work performed manually by human operators or other software agents.

Parameters:
taskName : str, optional

Fully-qualified name of the Task class that executed or will execute this Quantum. If not provided, taskClass must be.

taskClass : type, optional

The Task class that executed or will execute this Quantum. If not provided, taskName must be. Overrides taskName if both are provided.

dataId : DataId, optional

The dimension values that identify this Quantum.

run : str, optional

The name of the run this Quantum is a part of.

initInputs : collection of DatasetRef, optional

Datasets that are needed to construct an instance of the Task. May be a flat iterable of DatasetRef instances or a mapping from DatasetType to DatasetRef.

predictedInputs : Mapping, optional

Inputs identified prior to execution, organized as a mapping from DatasetType to a list of DatasetRef. Must be a superset of actualInputs.

actualInputs : Mapping, optional

Inputs actually used during execution, organized as a mapping from DatasetType to a list of DatasetRef. Must be a subset of predictedInputs.

outputs : Mapping, optional

Outputs from executing this quantum of work, organized as a mapping from DatasetType to a list of DatasetRef.

startTime : astropy.time.Time

The start time for the quantum.

endTime : astropy.time.Time

The end time for the quantum.

host : str

The system on this quantum was executed.

id : int, optional

Unique integer identifier for this quantum. Usually set to None (default) and assigned by Registry.

Attributes Summary

actualInputs A mapping of input datasets that were actually used, with the same form as Quantum.predictedInputs.
dataId The dimension values of the unit of processing (DataId).
endTime End timestamp for the execution of this quantum (astropy.time.Time).
host Name of the system on which this quantum was executed (str).
id Unique (autoincrement) integer for this quantum (int).
initInputs A mapping of datasets used to construct the Task, with DatasetType instances as keys (names can also be used for lookups) and DatasetRef instances as values.
outputs A mapping of output datasets (to be) generated for this quantum, with the same form as predictedInputs.
predictedInputs A mapping of input datasets that were expected to be used, with DatasetType instances as keys (names can also be used for lookups) and a list of DatasetRef instances as values.
run The name of the run this Quantum is a part of (str).
startTime Begin timestamp for the execution of this quantum (astropy.time.Time).
taskClass Task class associated with this Quantum (type).
taskName Fully-qualified name of the task associated with Quantum (str).

Methods Summary

addOutput(ref) Add an output DatasetRef to the Quantum.
addPredictedInput(ref) Add an input DatasetRef to the Quantum.

Attributes Documentation

actualInputs

A mapping of input datasets that were actually used, with the same form as Quantum.predictedInputs.

Notes

We cannot use set instead of list for the nested container because DatasetRef instances cannot be compared reliably when some have integers IDs and others do not.

dataId

The dimension values of the unit of processing (DataId).

endTime

End timestamp for the execution of this quantum (astropy.time.Time).

host

Name of the system on which this quantum was executed (str).

id

Unique (autoincrement) integer for this quantum (int).

initInputs

A mapping of datasets used to construct the Task, with DatasetType instances as keys (names can also be used for lookups) and DatasetRef instances as values.

outputs

A mapping of output datasets (to be) generated for this quantum, with the same form as predictedInputs.

Notes

We cannot use set instead of list for the nested container because DatasetRef instances cannot be compared reliably when some have integers IDs and others do not.

predictedInputs

A mapping of input datasets that were expected to be used, with DatasetType instances as keys (names can also be used for lookups) and a list of DatasetRef instances as values.

Notes

We cannot use set instead of list for the nested container because DatasetRef instances cannot be compared reliably when some have integers IDs and others do not.

run

The name of the run this Quantum is a part of (str).

startTime

Begin timestamp for the execution of this quantum (astropy.time.Time).

taskClass

Task class associated with this Quantum (type).

taskName

Fully-qualified name of the task associated with Quantum (str).

Methods Documentation

addOutput(ref)

Add an output DatasetRef to the Quantum.

This does not automatically update a Registry; all outputs must be present before a Registry.addQuantum() is called.

Parameters:
ref : DatasetRef

Reference for a Dataset to add to the Quantum’s outputs.

addPredictedInput(ref)

Add an input DatasetRef to the Quantum.

This does not automatically update a Registry; all predictedInputs must be present before a Registry.addQuantum() is called.

Parameters:
ref : DatasetRef

Reference for a Dataset to add to the Quantum’s predicted inputs.