Dependencies

Methods for resolving result dependencies

momotor.options.dependencies.get_full_task_dependencies(recipe, config)

Generate the full dependency tree for all steps in the recipe. For each task, it lists the all tasks that it depends on, including dependencies of dependencies

Task ordering is preserved: the tasks listed in the result, both the the dict keys and the tuple values, are in the same order as the definitions in the recipe.

Parameters
Return type

Dict[StepTaskId, Tuple[StepTaskId, …]]

Returns

the tasks to tasks mapping. the ordering is guaranteed to be same as the order of the steps in the recipe

momotor.options.dependencies.get_task_dependencies(recipe, config, task_id)

Get direct dependencies for a single task.

Task ordering is preserved: the tasks listed in the result are in the same order as the definitions in the recipe.s

Parameters
Return type

Tuple[StepTaskId, …]

Returns

the dependencies

momotor.options.dependencies.reverse_task_dependencies(dependencies)

Reverses the dependency tree generated by get_task_dependencies(), i.e. for each step it lists which other steps depend on it.

Task ordering is preserved: the tasks listed in the result, both the dict keys and the tuple values, are in the same order as in the dependencies argument.

Parameters

dependencies (Dict[StepTaskId, Iterable[StepTaskId]]) – the task dependencies

Return type

Dict[StepTaskId, Tuple[StepTaskId, …]]

Returns

the reverse dependencies