Dispatcher.dispatch(inputs=None, outputs=None, cutoff=None, inputs_dist=None, wildcard=False, no_call=False, shrink=False, rm_unused_nds=False, select_output_kw=None, _wait_in=None, stopper=None)[source]

Evaluates the minimum workflow and data outputs of the dispatcher model from given inputs.

  • inputs (dict[str, T], list[str], iterable, optional) – Input data values.
  • outputs (list[str], iterable, optional) – Ending data nodes.
  • cutoff (float, int, optional) – Depth to stop the search.
  • inputs_dist (dict[str, int | float], optional) – Initial distances of input data nodes.
  • wildcard (bool, optional) – If True, when the data node is used as input and target in the ArciDispatch algorithm, the input value will be used as input for the connected functions, but not as output.
  • no_call (bool, optional) – If True data node estimation function is not used and the input values are not used.
  • shrink (bool, optional) –

    If True the dispatcher is shrink before the dispatch.

    See also


  • rm_unused_nds (bool, optional) – If True unused function and sub-dispatcher nodes are removed from workflow.
  • select_output_kw (dict, optional) – Kwargs of selector function to select specific outputs.
  • _wait_in (dict, optional) – Override wait inputs.
  • stopper (threading.Event, optional) – A semaphore to abort the dispatching.

Dictionary of estimated data node outputs.

Return type:

Result[str, T]



A dispatcher with a function \(log(b - a)\) and two data a and b with default values:

Dispatch without inputs. The default values are used as inputs:

>>> outputs = dsp.dispatch()
>>> sorted(outputs.items())
[('a', 0), ('b', 5), ('c', 0), ('d', 1), ('e', 0.0)]

Dispatch until data node c is estimated:

>>> outputs = dsp.dispatch(outputs=['c'])
>>> sorted(outputs.items())
 [('a', 0), ('b', 5), ('c', 0)]

Dispatch with one inputs. The default value of a is not used as inputs:

>>> outputs = dsp.dispatch(inputs={'a': 3})
>>> sorted(outputs.items())
 [('a', 3), ('b', 5), ('c', 3), ('d', 1)]