TaskInitNode¶
- class lsst.pipe.base.pipeline_graph.TaskInitNode(key: NodeKey, *, inputs: Mapping[str, ReadEdge], outputs: Mapping[str, WriteEdge], config_output: WriteEdge, imported_data: _TaskNodeImportedData | None = None, task_class_name: str | None = None, config_str: str | None = None)¶
Bases:
object
A node in a pipeline graph that represents the construction of a
PipelineTask
.- Parameters:
- key
NodeKey
Key that identifies this node in internal and exported networkx graphs.
- inputs
Mapping
[str
,ReadEdge
] Graph edges that represent inputs required just to construct an instance of this task, keyed by connection name.
- outputs~collections.abc.Mapping` [
str
,WriteEdge
] Graph edges that represent outputs of this task that are available after just constructing it, keyed by connection name.
This does not include the special
config_init_output
edge; useiter_all_outputs
to include that, too.- config_output
WriteEdge
The special init output edge that persists the task’s configuration.
- imported_data
_TaskNodeImportedData
, optional Internal struct that holds information that requires the task class to have been be imported.
- task_class_name
str
, optional Fully-qualified name of the task class. Must be provided if
imported_data
is not.- config_str
str
, optional Configuration for the task as a string of override statements. Must be provided if
imported_data
is not.
- key
Notes
When included in an exported
networkx
graph (e.g.PipelineGraph.make_xgraph
), task initialization nodes set the following node attributes:task_class_name
bipartite
(seeNodeType.bipartite
)task_class
(only ifis_imported
isTrue
)config
(only ifis_importd
isTrue
)
Attributes Summary
Configuration for the task.
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.
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 initialization node to those from the same task label in a different pipeline.
Return the configuration for this task as a string of override statements.
Iterate over all inputs required for construction.
Iterate over all outputs available after construction, 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.
- 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.
- 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: TaskInitNode) list[str] ¶
Compare the edges of this task initialization node to those from the same task label in a different pipeline.
- 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
- iter_all_inputs() Iterator[ReadEdge] ¶
Iterate over all inputs required for construction.
This is the same as iteration over
inputs.values()
, but it will be updated to include any automatic init-input connections added in the future, whileinputs
will continue to hold only task-defined init inputs.- Yields:
ReadEdge
All the inputs required for construction.