pypz.executors.operator.context module

class pypz.executors.operator.context.ExecutionContext(operator: Operator, exec_mode: ExecutionMode)

Bases: object

This class is intended to store context information and helper methods for the actual execution. The context itself is based on the current Operator.

Parameters:
  • operator – the actual operator instance to be executed

  • exec_modeExecutionMode

__exec_mode: ExecutionMode

The run mode of the execution. For more information refer to the ExecutorRunMode class

__exit_code: ExitCodes

Exit code of the state machine, which can be modified among the states

__operator: Operator

The operator of the context

__plugin_type_registry: dict[Type[Plugin], set[Plugin]]

This member holds all the context entities along their implemented interfaces. It allows simple type based iteration/execution.

__typed_dependency_graphs: dict[Type[Plugin], list[set[Plugin]]]

This member holds the nested instances ordered by their resolved dependency list along their types. The key holds the instance type, the value is a list of set, where each list element represents a dependency level i.e., the 0th element holds the instances w/o dependencies, the 1st element holds the instances that are dependent on instances on the 0th level and so on.

for_each_plugin_instances(consumer: Callable[[PluginType], None]) None
for_each_plugin_objects_with_type(plugin_type: Type[PluginType], consumer: Callable[[PluginType], None]) None
get_dependency_graph_by_type(plugin_type: Type[PluginType]) list[set[PluginType]]
get_execution_mode() ExecutionMode
get_exit_code()
get_operator() Operator
get_plugin_instances_by_type(plugin_type: Type[PluginType]) set[PluginType]
set_exit_code(exit_code: ExitCodes)