Node Label#
This module defines classes for addressing nodes.
- _get_current_flow_name(ctx)[source]#
Get flow name of the current node from context.
- Return type:
str
- class NodeLabel(**data)[source]#
Bases:
BaseModelA label for a node. (a way to address a specific node in the script)
Can be relative if
flow_nameisNone: suchNodeLabelwill reference a node with the namenode_namein the current flow.- flow_name: Optional[str]#
Name of the flow in the script. Can be
Nonein which case this is inherited from theContext.current_node.
- node_name: str#
Name of the node in the flow.
- NodeLabelInitTypes#
Types that
NodeLabelcan be validated from.alias of
NodeLabel|Annotated[str, “node_name, flow name equal to current flow’s name”] |Tuple[Annotated[str, ‘flow_name’],Annotated[str, ‘node_name’]] |Annotated[List[str], ‘list of two strings (flow_name and node_name)’] |Annotated[dict, ‘dict following the NodeLabel data model’]
- class AbsoluteNodeLabel(**data)[source]#
Bases:
NodeLabelA label for a node. (a way to address a specific node in the script)
- flow_name: str#
Name of the flow in the script.
- node_name: str#
Name of the node in the flow.
- classmethod validate_from_node_label(data, info)[source]#
Allow instantiating of this class from
NodeLabel.Attempt to get the current flow name from context if
NodeLabel.flow_nameis empty.
- AbsoluteNodeLabelInitTypes#
Types that
AbsoluteNodeLabelcan be validated from.alias of
AbsoluteNodeLabel|NodeLabel|Tuple[Annotated[str, ‘flow_name’],Annotated[str, ‘node_name’]] |Annotated[List[str], ‘list of two strings (flow_name and node_name)’] |Annotated[dict, ‘dict following the AbsoluteNodeLabel data model’]