CatalogSummaryBaseConnections¶
- class lsst.faro.base.CatalogSummaryBaseConnections(*, config: PipelineTaskConfig | None = None)¶
- Bases: - MetricConnections- Attributes Summary - Mapping holding all connection attributes. - Set of dimension names that define the unit of work for this task. - Set with the names of all - InitInputconnection attributes.- Set with the names of all - InitOutputconnection attributes.- Set with the names of all - connectionTypes.Inputconnection attributes.- Connection for output dataset. - Set with the names of all - Outputconnection attributes.- Set with the names of all - PrerequisiteInputconnection attributes.- Methods Summary - adjustQuantum(inputs, outputs, label, data_id)- Override to make adjustments to - lsst.daf.butler.DatasetRefobjects in the- lsst.daf.butler.core.Quantumduring the graph generation stage of the activator.- buildDatasetRefs(quantum)- Build - QuantizedConnectioncorresponding to input- Quantum.- Attributes Documentation - allConnections: Mapping[str, BaseConnection] = {'measurement': Output(name='metricvalue_{agg_name}_{package}_{metric}', storageClass='MetricValue', doc='{agg_name} {package}_{metric}.', multiple=False, dimensions=('instrument', 'tract', 'band'), isCalibration=False)}¶
- Mapping holding all connection attributes. - This is a read-only view that is automatically updated when connection attributes are added, removed, or replaced in - __init__. It is also updated after- __init__completes to reflect changes in- inputs,- prerequisiteInputs,- outputs,- initInputs, and- initOutputs.
 - defaultTemplates = {'agg_name': None, 'metric': None, 'package': None}¶
 - dimensions: set[str] = {'band', 'instrument', 'skymap', 'tract'}¶
- Set of dimension names that define the unit of work for this task. - Required and implied dependencies will automatically be expanded later and need not be provided. - This may be replaced or modified in - __init__to change the dimensions of the task. After- __init__it will be a- frozensetand may not be replaced.
 - initInputs: set[str] = frozenset({})¶
- Set with the names of all - InitInputconnection attributes.- See - inputsfor additional information.
 - initOutputs: set[str] = frozenset({})¶
- Set with the names of all - InitOutputconnection attributes.- See - inputsfor additional information.
 - inputs: set[str] = frozenset({})¶
- Set with the names of all - connectionTypes.Inputconnection attributes.- This is updated automatically as class attributes are added, removed, or replaced in - __init__. Removing entries from this set will cause those connections to be removed after- __init__completes, but this is supported only for backwards compatibility; new code should instead just delete the collection attributed directly. After- __init__this will be a- frozensetand may not be replaced.
 - measurement¶
- Connection for output dataset. 
 - outputs: set[str] = frozenset({'measurement'})¶
- Set with the names of all - Outputconnection attributes.- See - inputsfor additional information.
 - prerequisiteInputs: set[str] = frozenset({})¶
- Set with the names of all - PrerequisiteInputconnection attributes.- See - inputsfor additional information.
 - Methods Documentation - adjustQuantum(inputs: dict[str, tuple[lsst.pipe.base.connectionTypes.BaseInput, collections.abc.Collection[lsst.daf.butler.core.datasets.ref.DatasetRef]]], outputs: dict[str, tuple[lsst.pipe.base.connectionTypes.Output, collections.abc.Collection[lsst.daf.butler.core.datasets.ref.DatasetRef]]], label: str, data_id: DataCoordinate) tuple[collections.abc.Mapping[str, tuple[lsst.pipe.base.connectionTypes.BaseInput, collections.abc.Collection[lsst.daf.butler.core.datasets.ref.DatasetRef]]], collections.abc.Mapping[str, tuple[lsst.pipe.base.connectionTypes.Output, collections.abc.Collection[lsst.daf.butler.core.datasets.ref.DatasetRef]]]]¶
- Override to make adjustments to - lsst.daf.butler.DatasetRefobjects in the- lsst.daf.butler.core.Quantumduring the graph generation stage of the activator.- Parameters:
- inputsdict
- Dictionary whose keys are an input (regular or prerequisite) connection name and whose values are a tuple of the connection instance and a collection of associated - DatasetRefobjects. The exact type of the nested collections is unspecified; it can be assumed to be multi-pass iterable and support- lenand- in, but it should not be mutated in place. In contrast, the outer dictionaries are guaranteed to be temporary copies that are true- dictinstances, and hence may be modified and even returned; this is especially useful for delegating to- super(see notes below).
- outputsMapping
- Mapping of output datasets, with the same structure as - inputs.
- labelstr
- Label for this task in the pipeline (should be used in all diagnostic messages). 
- data_idlsst.daf.butler.DataCoordinate
- Data ID for this quantum in the pipeline (should be used in all diagnostic messages). 
 
- inputs
- Returns:
- adjusted_inputsMapping
- Mapping of the same form as - inputswith updated containers of input- DatasetRefobjects. Connections that are not changed should not be returned at all. Datasets may only be removed, not added. Nested collections may be of any multi-pass iterable type, and the order of iteration will set the order of iteration within- PipelineTask.runQuantum.
- adjusted_outputsMapping
- Mapping of updated output datasets, with the same structure and interpretation as - adjusted_inputs.
 
- adjusted_inputs
- Raises:
- ScalarError
- Raised if any - Inputor- PrerequisiteInputconnection has- multipleset to- False, but multiple datasets.
- NoWorkFound
- Raised to indicate that this quantum should not be run; not enough datasets were found for a regular - Inputconnection, and the quantum should be pruned or skipped.
- FileNotFoundError
- Raised to cause QuantumGraph generation to fail (with the message included in this exception); not enough datasets were found for a - PrerequisiteInputconnection.
 
 - Notes - The base class implementation performs important checks. It always returns an empty mapping (i.e. makes no adjustments). It should always called be via - superby custom implementations, ideally at the end of the custom implementation with already-adjusted mappings when any datasets are actually dropped, e.g.:- def adjustQuantum(self, inputs, outputs, label, data_id): # Filter out some dataset refs for one connection. connection, old_refs = inputs["my_input"] new_refs = [ref for ref in old_refs if ...] adjusted_inputs = {"my_input", (connection, new_refs)} # Update the original inputs so we can pass them to super. inputs.update(adjusted_inputs) # Can ignore outputs from super because they are guaranteed # to be empty. super().adjustQuantum(inputs, outputs, label_data_id) # Return only the connections we modified. return adjusted_inputs, {} - Removing outputs here is guaranteed to affect what is actually passed to - PipelineTask.runQuantum, but its effect on the larger graph may be deferred to execution, depending on the context in which- adjustQuantumis being run: if one quantum removes an output that is needed by a second quantum as input, the second quantum may not be adjusted (and hence pruned or skipped) until that output is actually found to be missing at execution time.- Tasks that desire zip-iteration consistency between any combinations of connections that have the same data ID should generally implement - adjustQuantumto achieve this, even if they could also run that logic during execution; this allows the system to see outputs that will not be produced because the corresponding input is missing as early as possible.
 - buildDatasetRefs(quantum: Quantum) tuple[lsst.pipe.base.connections.InputQuantizedConnection, lsst.pipe.base.connections.OutputQuantizedConnection]¶
- Build - QuantizedConnectioncorresponding to input- Quantum.- Parameters:
- quantumlsst.daf.butler.Quantum
- Quantum object which defines the inputs and outputs for a given unit of processing. 
 
- quantum
- Returns:
- retValtupleof (InputQuantizedConnection,
- OutputQuantizedConnection) Namespaces mapping attribute names (identifiers of connections) to butler references defined in the input- lsst.daf.butler.Quantum.
 
- retVal