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, barestr
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 requiresrepr
, not juststr
, because Python builtin containers always userepr
on their items, even in their implementations forstr
.Attributes Summary
Task label or dataset type name.
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_id¶
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.