7.2.14.2. load_dispatcher¶
- load_dispatcher(path)[source]¶
Load Dispatcher object in Python pickle format.
Pickles are a serialized byte stream of a Python object. This format will preserve Python objects used as nodes or edges.
- Parameters
path (str, file) – File or filename to write. File names ending in .gz or .bz2 will be uncompressed.
- Returns
A dispatcher that identifies the model adopted.
- Return type
schedula.Dispatcher
Example:
>>> from schedula import Dispatcher >>> dsp = Dispatcher() >>> dsp.add_data('a', default_value=1) 'a' >>> dsp.add_function(function=max, inputs=['a', 'b'], outputs=['c']) 'max' >>> save_dispatcher(dsp, file_name) >>> dsp = load_dispatcher(file_name) >>> dsp.dispatch(inputs={'b': 3})['c'] 3