8.1.1.36. dispatch

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

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

Parameters:
  • inputs (dict[str, T], list[str], iterable, optional) – Input data values.

  • outputs (list[str], iterable, optional) – Ending data nodes.

  • inputs_dist (dict[str, int | float], optional) – Initial distances of input data nodes.

  • wildcard (bool, int, 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. If it is equal to 2, the the data node that cannot be calculated are excluded by the wildcard condition.

  • 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

    shrink_dsp()

  • 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 (multiprocess.Event, optional) – A semaphore to abort the dispatching.

  • executor (str, optional) – A pool executor id to dispatch asynchronously or in parallel.

  • sol_name (tuple[str], optional) – Solution name.

  • verbose (str, Callable, optional) – If True the dispatcher will log start and end of each function. If you pass a function you can customize the log message.

Returns:

Dictionary of estimated data node outputs.

Return type:

schedula.utils.sol.Solution

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

Example:

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()
>>> outputs
Solution({'a': 0, 'b': 5, 'd': 1, 'c': 0, 'e': 0.0})

Dispatch until data node c is estimated:

>>> outputs = dsp.dispatch(outputs=['c'])
>>> outputs
Solution({'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})
>>> outputs
Solution({'a': 3, 'b': 5, 'd': 1, 'c': 3})