7.2.15.1. Solution

class Solution(*args, **kwargs)[source]

Solution class for dispatch result.

Methods

__init__

check_cutoff

Stops the search of the investigated node of the ArciDispatch algorithm.

check_targets

Terminates ArciDispatch algorithm when all targets have been visited.

check_wait_in

Stops the search of the investigated node of the ArciDispatch algorithm, until all inputs are satisfied.

clear

copy

form

Creates a dispatcher Form Flask app.

fromkeys

Create a new ordered dictionary with keys from iterable and values set to value.

get

Return the value for key if key is in the dictionary, else default.

get_node

Returns a sub node of a dispatcher.

get_sub_dsp_from_workflow

Returns the sub-dispatcher induced by the workflow from sources.

items

keys

move_to_end

Move an existing element to the end (or beginning if last is false).

plot

Plots the Dispatcher with a graph in the DOT language with Graphviz.

pop

value.

popitem

Remove and return a (key, value) pair from the dictionary.

result

Set all asynchronous results.

setdefault

Insert key with a value of default if key is not in the dictionary.

update

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values

web

Creates a dispatcher Flask app.

wf_add_edge

wf_remove_edge

__init__(dsp=None, inputs=None, outputs=None, wildcard=False, cutoff=None, inputs_dist=None, no_call=False, rm_unused_nds=False, wait_in=None, no_domain=False, _empty=False, index=(-1,), full_name=(), verbose=False, excluded_defaults=())[source]
check_cutoff(distance)[source]

Stops the search of the investigated node of the ArciDispatch algorithm.

Parameters

distance (float, int) – Distance from the starting node.

Returns

True if distance > cutoff, otherwise False.

Return type

bool

check_wait_in(wait_in, n_id)[source]

Stops the search of the investigated node of the ArciDispatch algorithm, until all inputs are satisfied.

Parameters
  • wait_in (bool) – If True the node is waiting input estimations.

  • n_id (str) – Data or function node id.

Returns

True if all node inputs are satisfied, otherwise False.

Return type

bool

result(timeout=None)[source]

Set all asynchronous results.

Parameters

timeout (float) – The number of seconds to wait for the result if the futures aren’t done. If None, then there is no limit on the wait time.

Returns

Update Solution.

Return type

Solution

get_sub_dsp_from_workflow(sources, reverse=False, add_missing=False, check_inputs=True)[source]

Returns the sub-dispatcher induced by the workflow from sources.

The induced sub-dispatcher of the dsp contains the reachable nodes and edges evaluated with breadth-first-search on the workflow graph from source nodes.

Parameters
  • sources (list[str], iterable) – Source nodes for the breadth-first-search. A container of nodes which will be iterated through once.

  • reverse (bool, optional) – If True the workflow graph is assumed as reversed.

  • add_missing (bool, optional) – If True, missing function’ inputs are added to the sub-dispatcher.

  • check_inputs (bool, optional) – If True the missing function’ inputs are not checked.

Returns

A sub-dispatcher.

Return type

schedula.dispatcher.Dispatcher

property pipe

Returns the full pipe of a dispatch run.

check_targets(node_id)[source]

Terminates ArciDispatch algorithm when all targets have been visited.

Parameters

node_id (str) – Data or function node id.

Returns

True if all targets have been visited, otherwise False.

Return type

bool