TaskNode¶
- class lsst.pipe.base.pipeline_graph.TaskNode(key: NodeKey, init: TaskInitNode, *, prerequisite_inputs: Mapping[str, ReadEdge], inputs: Mapping[str, ReadEdge], outputs: Mapping[str, WriteEdge], log_output: WriteEdge | None, metadata_output: WriteEdge, dimensions: DimensionGroup | frozenset[str])¶
Bases:
object
A node in a pipeline graph that represents a labeled configuration of a
PipelineTask
.- Parameters:
- key
NodeKey
Identifier for this node in networkx graphs.
- init
TaskInitNode
Node representing the initialization of this task.
- prerequisite_inputs
Mapping
[str
,ReadEdge
] Graph edges that represent prerequisite inputs to this task, keyed by connection name.
Prerequisite inputs must already exist in the data repository when a
QuantumGraph
is built, but have more flexibility in how they are looked up than regular inputs.- inputs
Mapping
[str
,ReadEdge
] Graph edges that represent regular runtime inputs to this task, keyed by connection name.
- outputs~collections.abc.Mapping` [
str
,WriteEdge
] Graph edges that represent regular runtime outputs of this task, keyed by connection name.
This does not include the special
log_output
andmetadata_output
edges; useiter_all_outputs
to include that, too.- log_output
WriteEdge
orNone
The special runtime output that persists the task’s logs.
- metadata_output
WriteEdge
The special runtime output that persists the task’s metadata.
- dimensions
lsst.daf.butler.DimensionGroup
orfrozenset
[str
] Dimensions of the task. If a
frozenset
, the dimensions have not been resolved by aDimensionUniverse
and cannot be safely compared to other sets of dimensions.
- key
Notes
Task nodes are intentionally not equality comparable, since there are many different (and useful) ways to compare these objects with no clear winner as the most obvious behavior.
When included in an exported
networkx
graph (e.g.PipelineGraph.make_xgraph
), task nodes set the following node attributes:task_class_name
bipartite
(seeNodeType.bipartite
)task_class
(only ifis_imported
isTrue
)config
(only ifis_imported
isTrue
)
Attributes Summary
Configuration for the task.
Standardized dimensions of the task.
Whether the
dimensions
attribute may be accessed.Whether this the task type for this node has been imported and its configuration overrides applied.
Label of this configuration of a task in the pipeline.
Raw dimensions of the task, with standardization by a
DimensionUniverse
not guaranteed.Type object for the task.
The fully-qualified string name of the task class.
Methods Summary
diff_edges
(other)Compare the edges of this task node to those from the same task label in a different pipeline.
Return the configuration for this task as a string of override statements.
Return the connections class instance for this task.
get_lookup_function
(connection_name)Return the custom dataset query function for an edge, if one exists.
Return the names of connections whose data IDs should be included in the calculation of the spatial bounds for this task's quanta.
Return the names of connections whose data IDs should be included in the calculation of the temporal bounds for this task's quanta.
Iterate over all runtime inputs, including both regular inputs and prerequisites.
Iterate over all runtime outputs, including special ones.
Attributes Documentation
- config¶
Configuration for the task.
This is always frozen.
Accessing this attribute when
is_imported
isFalse
will raiseTaskNotImportedError
, but callingget_config_str
will not.
- dimensions¶
Standardized dimensions of the task.
- has_resolved_dimensions¶
Whether the
dimensions
attribute may be accessed.If
False
, theraw_dimensions
attribute may be used to obtain a set of dimension names that has not been resolved by aDimensionsUniverse
.
- is_imported¶
Whether this the task type for this node has been imported and its configuration overrides applied.
If this is
False
, thetask_class
andconfig
attributes may not be accessed.
- label¶
Label of this configuration of a task in the pipeline.
- raw_dimensions¶
Raw dimensions of the task, with standardization by a
DimensionUniverse
not guaranteed.
- task_class¶
Type object for the task.
Accessing this attribute when
is_imported
isFalse
will raiseTaskNotImportedError
, but accessingtask_class_name
will not.
- task_class_name¶
The fully-qualified string name of the task class.
Methods Documentation
- diff_edges(other: TaskNode) list[str] ¶
Compare the edges of this task node to those from the same task label in a different pipeline.
This also calls
TaskInitNode.diff_edges
.- Parameters:
- other
TaskInitNode
Other node to compare to. Must have the same task label, but need not have the same configuration or even the same task class.
- other
- Returns:
- get_config_str() str ¶
Return the configuration for this task as a string of override statements.
- Returns:
- config_str
str
String containing configuration-overload statements.
- config_str
- get_connections() PipelineTaskConnections ¶
Return the connections class instance for this task.
- Returns:
- connections
PipelineTaskConnections
Task-provided object that defines inputs and outputs from configuration.
- connections
- get_lookup_function(connection_name: str) Callable[[DatasetType, Registry, DataCoordinate, Sequence[str]], Iterable[DatasetRef]] | None ¶
Return the custom dataset query function for an edge, if one exists.
- Parameters:
- connection_name
str
Name of the connection.
- connection_name
- Returns:
- lookup_function
Callable
orNone
Callable that takes a dataset type, a butler registry, a data coordinate (the quantum data ID), and an ordered list of collections to search, and returns an iterable of
DatasetRef
.
- lookup_function
- get_spatial_bounds_connections() frozenset[str] ¶
Return the names of connections whose data IDs should be included in the calculation of the spatial bounds for this task’s quanta.
- get_temporal_bounds_connections() frozenset[str] ¶
Return the names of connections whose data IDs should be included in the calculation of the temporal bounds for this task’s quanta.