7.1.1.9. get_nodeΒΆ

Dispatcher.get_node(*node_ids, *, node_attr=none)

Returns a sub node of a dispatcher.

Parameters:
  • node_ids (str) – A sequence of node ids or a single node id. The id order identifies a dispatcher sub-level.
  • node_attr (str, None, optional) –

    Output node attr.

    If the searched node does not have this attribute, all its attributes are returned.

    When ‘auto’, returns the “default” attributes of the searched node, which are:

    • for data node: its output, and if not exists, all its attributes.
    • for function and sub-dispatcher nodes: the ‘function’ attribute.

    When ‘description’, returns the “description” of the searched node, searching also in function or sub-dispatcher input/output description.

    When ‘output’, returns the data node output.

    When ‘default_value’, returns the data node default value.

    When ‘value_type’, returns the data node value’s type.

    When None, returns the node attributes.

Returns:

Node attributes and its real path.

Return type:

(T, (str, ...))

Example:

digraph workflow { graph [ratio=1] node [style=filled] label = <workflow> splines = ortho style = filled 55 [label=<<TABLE border="0" cellspacing="0"><TR><TD border="0" colspan="2" href="./dispatcher-2d06435e5aab4ad97f99e77067ca941be8cd6776/Sub-dispatcher.html">Sub-dispatcher</TD></TR><TR><TD align="RIGHT" border="1">distance</TD><TD align="LEFT" border="1">1.0</TD></TR><TR><TD align="RIGHT" border="1">started</TD><TD align="LEFT" border="1">2018-06-05T10:44:15.124364</TD></TR><TR><TD align="RIGHT" border="1">duration</TD><TD align="LEFT" border="1">0:00:00.000570</TD></TR></TABLE>> fillcolor=yellow shape=note style=filled tooltip="Sub-dispatcher"] 56 [label=<<TABLE border="0" cellspacing="0"><TR><TD border="0" colspan="2" href="./dispatcher-2d06435e5aab4ad97f99e77067ca941be8cd6776/a-output.html">a</TD></TR><TR><TD align="RIGHT" border="1">distance</TD><TD align="LEFT" border="1">0.0</TD></TR></TABLE>> fillcolor=cyan shape=box style="rounded,filled" tooltip=a] 57 [label=<<TABLE border="0" cellspacing="0"><TR><TD border="0" colspan="2" href="./dispatcher-2d06435e5aab4ad97f99e77067ca941be8cd6776/b-output.html">b</TD></TR><TR><TD align="RIGHT" border="1">distance</TD><TD align="LEFT" border="1">2.0</TD></TR></TABLE>> fillcolor=cyan shape=box style="rounded,filled" tooltip=b] 58 [label=start fillcolor=red shape=egg] 55 -> 57 58 -> 56 56 -> 55 }

Get the sub node output:

>>> d.get_node('Sub-dispatcher', 'c')
(4, ('Sub-dispatcher', 'c'))
>>> d.get_node('Sub-dispatcher', 'c', node_attr='type')
('data', ('Sub-dispatcher', 'c'))
>>> sub_dsp, sub_dsp_id = d.get_node('Sub-dispatcher')

digraph workflow { graph [ratio=1] node [style=filled] label = <workflow> splines = ortho style = filled 72 [label=<<TABLE border="0" cellspacing="0"><TR><TD border="0" colspan="2" href="./dispatcher-e7fdaa767629f1ee50c33184e60ca16232ee7525/a-output.html">a</TD></TR><TR><TD align="RIGHT" border="1">distance</TD><TD align="LEFT" border="1">0.0</TD></TR></TABLE>> fillcolor=cyan shape=box style="rounded,filled" tooltip=a] 73 [label=<<TABLE border="0" cellspacing="0"><TR><TD border="0" colspan="2" href="./dispatcher-e7fdaa767629f1ee50c33184e60ca16232ee7525/fun.html">a + b</TD></TR><TR><TD align="RIGHT" border="1">distance</TD><TD align="LEFT" border="1">1.0</TD></TR><TR><TD align="RIGHT" border="1">started</TD><TD align="LEFT" border="1">2018-06-05T10:44:16.083920</TD></TR><TR><TD align="RIGHT" border="1">duration</TD><TD align="LEFT" border="1">0:00:00.000018</TD></TR></TABLE>> fillcolor=springgreen shape=box tooltip="a + b"] 74 [label=<<TABLE border="0" cellspacing="0"><TR><TD border="0" colspan="2" href="./dispatcher-e7fdaa767629f1ee50c33184e60ca16232ee7525/b-output.html">b</TD></TR><TR><TD align="RIGHT" border="1">distance</TD><TD align="LEFT" border="1">0.0</TD></TR></TABLE>> fillcolor=cyan shape=box style="rounded,filled" tooltip=b] 75 [label=<<TABLE border="0" cellspacing="0"><TR><TD border="0" colspan="2" href="./dispatcher-e7fdaa767629f1ee50c33184e60ca16232ee7525/c-output.html">c</TD></TR><TR><TD align="RIGHT" border="1">distance</TD><TD align="LEFT" border="1">2.0</TD></TR></TABLE>> fillcolor=cyan shape=box style="rounded,filled" tooltip=c] 76 [label=start fillcolor=red shape=egg] 73 -> 75 74 -> 73 76 -> 72 72 -> 73 76 -> 74 }