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: DimensionGraph | frozenset)¶
Bases:
objectA 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
QuantumGraphis 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_outputandmetadata_outputedges; useiter_all_outputsto include that, too.- log_output
WriteEdgeorNone 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.DimensionGraphorfrozenset Dimensions of the task. If a
frozenset, the dimensions have not been resolved by aDimensionUniverseand 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
networkxgraph (e.g.PipelineGraph.make_xgraph), task nodes set the following node attributes:task_class_namebipartite(seeNodeType.bipartite)task_class(only ifis_importedisTrue)config(only ifis_importdisTrue)
Attributes Summary
Configuration for the task.
Standardized dimensions of the task.
Whether the
dimensionsattribute 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
DimensionUniversenot 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.
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_importedisFalsewill raiseTaskNotImportedError, but callingget_config_strwill not.
- dimensions¶
Standardized dimensions of the task.
- has_resolved_dimensions¶
Whether the
dimensionsattribute may be accessed.If
False, theraw_dimensionsattribute 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_classandconfigattributes 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
DimensionUniversenot guaranteed.
- task_class¶
Type object for the task.
Accessing this attribute when
is_importedisFalsewill raiseTaskNotImportedError, but accessingtask_class_namewill 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_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
CallableorNone 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.