8.2.8.26.25. __dict__ΒΆ

run_model.__dict__ = mappingproxy({'__module__': 'schedula.utils.dsp', '__doc__': "\n    It is an utility function to execute dynamically generated function/models\n    and - if Dispatcher based - add their workflows to the parent solution.\n\n    :return:\n        A function that executes the dispatch of the given `dsp`.\n    :rtype: callable\n\n    **Example**:\n\n    Follows a simple example on how to use the\n    :func:`~schedula.utils.dsp.run_model`:\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(\n        ...     function_id='execute_dsp', function=run_model,\n        ...     inputs=['dsp_model', 'inputs'], outputs=['outputs']\n        ... )\n        'execute_dsp'\n        >>> dsp_model = Dispatcher(name='Model')\n        >>> dsp_model.add_function('max', max, inputs=['a', 'b'], outputs=['c'])\n        'max'\n        >>> sol = dsp({'dsp_model': dsp_model, 'inputs': {'b': 1, 'a': 2}})\n        >>> sol['outputs']\n        Solution({'a': 2, 'b': 1, 'c': 2})\n        >>> sol.workflow.nodes['execute_dsp']['solution']\n        Solution({'a': 2, 'b': 1, 'c': 2})\n\n    Moreover, it can be used also with all\n    :func:`~schedula.utils.dsp.SubDispatcher` like objects::\n\n        >>> sub_dsp = SubDispatch(dsp_model, outputs=['c'], output_type='list')\n        >>> sol = dsp({'dsp_model': sub_dsp, 'inputs': {'b': 1, 'a': 2}})\n        >>> sol['outputs']\n        [2]\n        >>> sol.workflow.nodes['execute_dsp']['solution']\n        Solution({'a': 2, 'b': 1, 'c': 2})\n    ", '__init__': <function run_model.__init__>, '__call__': <function run_model.__call__>, '__dict__': <attribute '__dict__' of 'run_model' objects>, '__weakref__': <attribute '__weakref__' of 'run_model' objects>, '__annotations__': {}})