NodeKey

class lsst.pipe.base.pipeline_graph.NodeKey(node_type: NodeType, name: str)

Bases: NamedTuple

A special key type for nodes in networkx graphs.

Notes

Using a tuple for the key allows tasks labels and dataset type names with the same string value to coexist in the graph. These only rarely appear in PipelineGraph public interfaces; when the node type is implicit, bare str task labels or dataset type names are used instead.

NodeKey objects stringify to just their name, which is used both as a way to convert to the str objects used in the main public interface and as an easy way to usefully stringify containers returned directly by networkx algorithms (especially in error messages). Note that this requires repr, not just str, because Python builtin containers always use repr on their items, even in their implementations for str.

Attributes Summary

name

Task label or dataset type name.

node_type

Node type enum for this key.

Methods Summary

count(value, /)

Return number of occurrences of value.

index(value[, start, stop])

Return first index of value.

Attributes Documentation

name: str

Task label or dataset type name.

This is always the parent dataset type name for component dataset types.

node_type: NodeType

Node type enum for this key.

Methods Documentation

count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=sys.maxsize, /)

Return first index of value.

Raises ValueError if the value is not present.