PrerequisiteFinder

class lsst.pipe.base.prerequisite_helpers.PrerequisiteFinder(edge: ReadEdge, bounds: PrerequisiteBounds, pipeline_graph: PipelineGraph)

Bases: object

A QuantumGraph-generation helper class that manages the searches for a prerequisite input connection.

Parameters:
edgepipeline_graph.ReadEdge

A PipelineGraph edge that represents a single prerequisite input connection.

boundsPrerequisiteBounds

Another helper object that manages the spatial/temporal bounds of the task’s quanta, shared by all prerequisite inputs for that task.

pipeline_graphpipeline_graph.PipelineGraph

Graph representation of the pipeline.

Notes

PrerequisiteFinder instances are usually constructed by a PrerequisiteInfo instance, which is in turn constructed by and attached to the base QuantumGraphBuilder when a new builder is constructed. During the QuantumGraphBuilder.process_subgraph hook implemented by a builder subclass, prerequisite inputs may be found in other ways (e.g. via bulk queries), as long as the results are consistent with the finder’s attributes, and this is indicated to the base QuantumGraphBuilder by removing those finder instances after those prerequisites have been found and added to a QuantumGraphSkeleton. Finder instances that remain in the builder are used by calling PrerequisiteFinder.find on each quantum later in QuantumGraphBuilder.build.

Attributes Summary

task_node

The PipelineGraph node that represents the task for this connection.

Methods Summary

find(butler, input_collections, data_id, ...)

Find prerequisite input datasets for a single quantum.

Attributes Documentation

task_node

The PipelineGraph node that represents the task for this connection.

Methods Documentation

find(butler: Butler, input_collections: Sequence[str], data_id: DataCoordinate, skypix_bounds: Mapping[str, RangeSet], timespan: Timespan | None) list[lsst.daf.butler._dataset_ref.DatasetRef]

Find prerequisite input datasets for a single quantum.

Parameters:
butlerlsst.daf.butler.Butler

Butler client to use for queries.

input_collectionsSequence [ str ]

Sequence of collections to search, in order.

data_idlsst.daf.butler.DataCoordinate

Data ID for the quantum.

skypix_boundsMapping [ str, lsst.sphgeom.RangeSet ]

The spatial bounds of this quantum in various skypix dimensions. Keys are skypix dimension names (a superset of those in dataset_skypix) and values are sets of integer pixel ID ranges.

timespanlsst.daf.butler.Timespan or None

The temporal bounds of this quantum. Guaranteed to not be None if dataset_has_timespan is True.

Returns:
refslist [ lsst.daf.butler.DatasetRef ]

Dataset references. These use self.dataset_type_node.dataset_type, which may differ from the connection’s dataset type in storage class or [lack of] component.

Raises:
NotImplementedError

Raised for certain relationships between task and dataset type dimensions that are possible to define but not believed to be useful in practice. These errors occur late rather than early in order to allow a QuantumGraphBuilder subclass to handle them first, in case an unusual task’s needs must be met by a custom builder class anyway.