lsst.pipe.base
19.0.0-24-g878c510+13
|
Public Member Functions | |
def | __init__ (self, Butler butler, Quantum quantum) |
object | get (self, typing.Union[InputQuantizedConnection, typing.List[DatasetRef], DatasetRef] dataset) |
def | put (self, typing.Union[Struct, typing.List[typing.Any], object] values, typing.Union[OutputQuantizedConnection, typing.List[DatasetRef], DatasetRef] dataset) |
Public Attributes | |
quantum | |
registry | |
allInputs | |
allOutputs | |
Butler like class specialized for a single quantum A ButlerQuantumContext class wraps a standard butler interface and specializes it to the context of a given quantum. What this means in practice is that the only gets and puts that this class allows are DatasetRefs that are contained in the quantum. In the future this class will also be used to record provenance on what was actually get and put. This is in contrast to what the preflight expects to be get and put by looking at the graph before execution. Parameters ---------- butler : `lsst.daf.butler.Butler` Butler object from/to which datasets will be get/put quantum : `lsst.daf.butler.core.Quantum` Quantum object that describes the datasets which will be get/put by a single execution of this node in the pipeline graph.
Definition at line 35 of file butlerQuantumContext.py.
def lsst.pipe.base.butlerQuantumContext.ButlerQuantumContext.__init__ | ( | self, | |
Butler | butler, | ||
Quantum | quantum | ||
) |
Definition at line 57 of file butlerQuantumContext.py.
object lsst.pipe.base.butlerQuantumContext.ButlerQuantumContext.get | ( | self, | |
typing.Union[InputQuantizedConnection, typing.List[DatasetRef], DatasetRef] | dataset | ||
) |
Fetches data from the butler Parameters ---------- dataset This argument may either be an `InputQuantizedConnection` which describes all the inputs of a quantum, a list of `~lsst.daf.butler.DatasetRef`, or a single `~lsst.daf.butler.DatasetRef`. The function will get and return the corresponding datasets from the butler. Returns ------- return : `object` This function returns arbitrary objects fetched from the bulter. The structure these objects are returned in depends on the type of the input argument. If the input dataset argument is a InputQuantizedConnection, then the return type will be a dictionary with keys corresponding to the attributes of the `InputQuantizedConnection` (which in turn are the attribute identifiers of the connections). If the input argument is of type `list` of `~lsst.daf.butler.DatasetRef` then the return type will be a list of objects. If the input argument is a single `~lsst.daf.butler.DatasetRef` then a single object will be returned. Raises ------ ValueError If a `DatasetRef` is passed to get that is not defined in the quantum object
Definition at line 87 of file butlerQuantumContext.py.
def lsst.pipe.base.butlerQuantumContext.ButlerQuantumContext.put | ( | self, | |
typing.Union[Struct, typing.List[typing.Any], object] | values, | ||
typing.Union[OutputQuantizedConnection, typing.List[DatasetRef], DatasetRef] | dataset | ||
) |
Puts data into the butler Parameters ---------- values : `Struct` or `list` of `object` or `object` The data that should be put with the butler. If the type of the dataset is `OutputQuantizedConnection` then this argument should be a `Struct` with corresponding attribute names. Each attribute should then correspond to either a list of object or a single object depending of the type of the corresponding attribute on dataset. I.e. if dataset.calexp is [datasetRef1, datasetRef2] then values.calexp should be [calexp1, calexp2]. Like wise if there is a single ref, then only a single object need be passed. The same restriction applies if dataset is directly a `list` of `DatasetRef` or a single `DatasetRef`. dataset This argument may either be an `InputQuantizedConnection` which describes all the inputs of a quantum, a list of `lsst.daf.butler.DatasetRef`, or a single `lsst.daf.butler.DatasetRef`. The function will get and return the corresponding datasets from the butler. Raises ------ ValueError If a `DatasetRef` is passed to put that is not defined in the quantum object, or the type of values does not match what is expected from the type of dataset.
Definition at line 134 of file butlerQuantumContext.py.
lsst.pipe.base.butlerQuantumContext.ButlerQuantumContext.allInputs |
Definition at line 60 of file butlerQuantumContext.py.
lsst.pipe.base.butlerQuantumContext.ButlerQuantumContext.allOutputs |
Definition at line 61 of file butlerQuantumContext.py.
lsst.pipe.base.butlerQuantumContext.ButlerQuantumContext.quantum |
Definition at line 58 of file butlerQuantumContext.py.
lsst.pipe.base.butlerQuantumContext.ButlerQuantumContext.registry |
Definition at line 59 of file butlerQuantumContext.py.