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:
- keyNodeKey
- Identifier for this node in networkx graphs. 
- initTaskInitNode
- Node representing the initialization of this task. 
- prerequisite_inputsMapping[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.
- inputsMapping[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_outputand- metadata_outputedges; use- iter_all_outputsto include that, too.
- log_outputWriteEdgeorNone
- The special runtime output that persists the task’s logs. 
- metadata_outputWriteEdge
- The special runtime output that persists the task’s metadata. 
- dimensionslsst.daf.butler.DimensionGrouporfrozenset[str]
- Dimensions of the task. If a - frozenset, the dimensions have not been resolved by a- DimensionUniverseand 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_name
- bipartite(see- NodeType.bipartite)
- task_class(only if- is_importedis- True)
- config(only if- is_importedis- True)
 - 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. - 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. - is_optional(connection_name)- Check whether the given connection has - minimum==0.- 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_importedis- Falsewill raise- TaskNotImportedError, but calling- get_config_strwill not.
 - dimensions¶
- Standardized dimensions of the task. 
 - has_resolved_dimensions¶
- Whether the - dimensionsattribute may be accessed.- If - False, the- raw_dimensionsattribute may be used to obtain a set of dimension names that has not been resolved by a- DimensionsUniverse.
 - is_imported¶
- Whether this the task type for this node has been imported and its configuration overrides applied. - If this is - False, the- task_classand- configattributes 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_importedis- Falsewill raise- TaskNotImportedError, but accessing- task_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:
- otherTaskInitNode
- 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_strstr
- String containing configuration-overload statements. 
 
- config_str
 
 - get_connections() PipelineTaskConnections¶
- Return the connections class instance for this task. - Returns:
- connectionsPipelineTaskConnections
- 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_namestr
- Name of the connection. 
 
- connection_name
- Returns:
- lookup_functionCallableorNone
- 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.