run_recipe module
- class run_recipe.WorkerPlugin(options, *args, **kwargs)[source]
Bases:
WorkerPlugin
A dask worker plugin for setting defaults in the worker process
- Parameters:
- optionsdict
The dictionary containing the configuration for the worker, usually the same as for the launcher
Methods
setup
(worker)Run when the plugin is attached to a worker.
teardown
(worker)Run when the worker to which the plugin is attached is closed, or when the plugin is removed.
transition
(key, start, finish, **kwargs)Throughout the lifecycle of a task (see Worker State), Workers are instructed by the scheduler to compute certain tasks, resulting in transitions in the state of each task.
- run_recipe.compute_graph(jobs)[source]
Compute the task graph
- Parameters:
- jobsList[dask.Delayed]
The list of jobs/tasks to compute
- run_recipe.eval_recipe_tag_definitions(recipe: Recipe, attributes_regex_map, iterationvars_regex_map, parameters_regex_map, function_definitions_global_env: dict)[source]
- run_recipe.evaluate_function_definitions(recipe: Recipe)[source]
Evaluate the functions defined in recipe.function_definitions and make the compiled code available in a copy of the global environment of the interpreter. A copy of the global environment is used so as to not pollute the global namespace itself. All the defined functions share the same copy.
- Parameters:
- recipe: Recipe
The recipe in which the functions are to be made available.
- Returns:
- A shallow copy of the global environment with the compiled functions as members, i.e. a dictionary with the
- function names as key and the code as associated value.
- run_recipe.prepare_evaluation_phase(recipe: Recipe, options, data_repo, function_definitions_global_env: dict)[source]