8.2.8.22.35. __dict__ΒΆ

SubDispatchFunction.__dict__ = mappingproxy({'__module__': 'schedula.utils.dsp', '__doc__': "\n    It converts a :class:`~schedula.dispatcher.Dispatcher` into a function.\n\n    This function takes a sequence of arguments or a key values as input of the\n    dispatch.\n\n    :return:\n        A function that executes the dispatch of the given `dsp`.\n    :rtype: callable\n\n    .. seealso:: :func:`~schedula.dispatcher.Dispatcher.dispatch`,\n       :func:`~schedula.dispatcher.Dispatcher.shrink_dsp`\n\n    **Example**:\n\n    A dispatcher with two functions `max` and `min` and an unresolved cycle\n    (i.e., `a` --> `max` --> `c` --> `min` --> `a`):\n\n    .. dispatcher:: dsp\n       :opt: graph_attr={'ratio': '1'}\n\n        >>> from schedula import Dispatcher\n        >>> dsp = Dispatcher(name='Dispatcher')\n        >>> dsp.add_function('max', max, inputs=['a', 'b'], outputs=['c'])\n        'max'\n        >>> from math import log\n        >>> def my_log(x):\n        ...     return log(x - 1)\n        >>> dsp.add_function('log(x - 1)', my_log, inputs=['c'],\n        ...                  outputs=['a'], input_domain=lambda c: c > 1)\n        'log(x - 1)'\n\n    Extract a static function node, i.e. the inputs `a` and `b` and the\n    output `a` are fixed::\n\n        >>> fun = SubDispatchFunction(dsp, 'myF', ['a', 'b'], ['a'])\n        >>> fun.__name__\n        'myF'\n        >>> fun(b=1, a=2)\n        0.0\n\n    .. dispatcher:: fun\n       :opt: workflow=True, graph_attr={'ratio': '1'}\n\n        >>> fun.dsp.name = 'Created function internal'\n\n    The created function raises a ValueError if un-valid inputs are\n    provided:\n\n    .. dispatcher:: fun\n       :opt: workflow=True, graph_attr={'ratio': '1'}\n       :code:\n\n        >>> fun(1, 0)  # doctest: +IGNORE_EXCEPTION_DETAIL\n        Traceback (most recent call last):\n        ...\n        DispatcherError:\n          Unreachable output-targets: ...\n          Available outputs: ...\n    ", 'var_keyword': 'kw', '__init__': <function SubDispatchFunction.__init__>, '__signature__': <property object>, '_parse_inputs': <function SubDispatchFunction._parse_inputs>, '__call__': <function SubDispatchFunction.__call__>, '__annotations__': {}})