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: 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 QuantumGraph is 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_output and metadata_output edges; use iter_all_outputs to include that, too.

log_outputWriteEdge or None

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.DimensionGraph or frozenset

Dimensions of the task. If a frozenset, the dimensions have not been resolved by a DimensionUniverse and cannot be safely compared to other sets of dimensions.

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 (see NodeType.bipartite)

  • task_class (only if is_imported is True)

  • config (only if is_importd is True)

Attributes Summary

config

Configuration for the task.

dimensions

Standardized dimensions of the task.

has_resolved_dimensions

Whether the dimensions attribute may be accessed.

is_imported

Whether this the task type for this node has been imported and its configuration overrides applied.

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.

task_class_name

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.

get_config_str()

Return the configuration for this task as a string of override statements.

iter_all_inputs()

Iterate over all runtime inputs, including both regular inputs and prerequisites.

iter_all_outputs()

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 is False will raise TaskNotImportedError, but calling get_config_str will not.

dimensions

Standardized dimensions of the task.

has_resolved_dimensions

Whether the dimensions attribute may be accessed.

If False, the raw_dimensions attribute 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_class and config 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 is False will raise TaskNotImportedError, but accessing task_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:
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.

Returns:
differenceslist [ str ]

List of string messages describing differences between self and other. Will be empty if the two nodes have the same edges. Messages will use ‘A’ to refer to self and ‘B’ to refer to other.

get_config_str() str

Return the configuration for this task as a string of override statements.

Returns:
config_strstr

String containing configuration-overload statements.

iter_all_inputs() Iterator[ReadEdge]

Iterate over all runtime inputs, including both regular inputs and prerequisites.

iter_all_outputs() Iterator[WriteEdge]

Iterate over all runtime outputs, including special ones.