7.1.1.13. get_sub_dsp

Dispatcher.get_sub_dsp(nodes_bunch, edges_bunch=None)[source]

Returns the sub-dispatcher induced by given node and edge bunches.

The induced sub-dispatcher contains the available nodes in nodes_bunch and edges between those nodes, excluding those that are in edges_bunch.

The available nodes are non isolated nodes and function nodes that have all inputs and at least one output.

Parameters:
  • nodes_bunch (list[str], iterable) – A container of node ids which will be iterated through once.
  • edges_bunch (list[(str, str)], iterable, optional) – A container of edge ids that will be removed.
Returns:

A dispatcher.

Return type:

Dispatcher

Note

The sub-dispatcher edge or node attributes just point to the original dispatcher. So changes to the node or edge structure will not be reflected in the original dispatcher map while changes to the attributes will.

——————————————————————–

Example:

A dispatcher with a two functions fun1 and fun2:

Get the sub-dispatcher induced by given nodes bunch:

>>> sub_dsp = dsp.get_sub_dsp(['a', 'c', 'd', 'e', 'fun2'])