6.4.2.11. get_nodeΒΆ

Dispatcher.get_node(*node_ids, node_attr='auto')[source]

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:

Get the sub node output:

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