7.2.8. dspΒΆ

It provides tools to create models with the Dispatcher.

Functions

add_function

Decorator to add a function to a dispatcher.

are_in_nested_dicts

Nested keys are inside of nested-dictionaries.

bypass

Returns the same arguments.

combine_dicts

Combines multiple dicts in one.

combine_nested_dicts

Merge nested-dictionaries.

get_nested_dicts

Get/Initialize the value of nested-dictionaries.

kk_dict

Merges and defines dictionaries with values identical to keys.

map_dict

Returns a dict with new key values.

map_list

Returns a new dict.

parent_func

Return the parent function of a wrapped function (wrapped with functools.partial and add_args).

replicate_value

Replicates n times the input value.

selector

Selects the chosen dictionary keys from the given dictionary.

stack_nested_keys

Stacks the keys of nested-dictionaries into tuples and yields a list of k-v pairs.

stlp

Converts a string in a tuple.

summation

Sums inputs values.

Classes

DispatchPipe

It converts a Dispatcher into a function.

MapDispatch

It dynamically builds a Dispatcher that is used to invoke recursivelly a dispatching function that is defined by a constructor function that takes a dsp base model as input.

NoSub

Class for avoiding to add a sub solution to the workflow.

SubDispatch

It dispatches a given Dispatcher like a function.

SubDispatchFunction

It converts a Dispatcher into a function.

SubDispatchPipe

It converts a Dispatcher into a function.

add_args

inf

Class to model infinite numbers for workflow distance.

run_model

It is an utility function to execute dynamically generated function/models and - if Dispatcher based - add their workflows to the parent solution.