netunicorn.base.pipeline.CyclePipeline¶
- class CyclePipeline(cycles=None, tasks=(), early_stopping=True, report_results=True, environment_definition=None)[source]¶
Bases:
Pipeline
CyclePipeline is a Pipeline that will be executed several times. All defined stages would be executed and then the execution would continue from the first stage again.
- Parameters:
cycles (
Optional
[int
], default:None
)tasks (
Collection
[Union
[Task
,TaskDispatcher
,Collection
[Union
[Task
,TaskDispatcher
]]]], default:()
)early_stopping (
bool
, default:True
)report_results (
bool
, default:True
)environment_definition (
Optional
[EnvironmentDefinition
], default:None
)
Attributes
Current last stage of the pipeline.
Execution Graph name.
Whether to stop executing tasks after a first failure.
Whether executor should connect core services to report execution results in the end.
Environment definition for the execution graph.
Graph of tasks and their order.
Disable graph validation.
Methods
Return a copy of the pipeline.
Draw execution graph using networkx library.
Validates execution graph according to the ExecutionGraph rules.
Add a task or list of tasks as a separate stage to the end of the pipeline.
- draw(nx_layout_function=<function shell_layout>)[source]¶
Draw execution graph using networkx library.
- Parameters:
nx_layout_function (default:
<function shell_layout at 0x7fdfbd01c280>
) – networkx layout function to use for drawing (from networkx.drawing.layout)- Returns:
None
– None
- static is_execution_graph_valid(obj)[source]¶
Validates execution graph according to the ExecutionGraph rules.
- Returns:
bool
– True if execution graph is valid, raises an exception otherwise- Parameters:
obj (
ExecutionGraph
)
- then(element)[source]¶
Add a task or list of tasks as a separate stage to the end of the pipeline.
- Parameters:
element (
Union
[Task
,TaskDispatcher
,Collection
[Union
[Task
,TaskDispatcher
]]]) – a task or tuple of tasks to be added- Returns:
Pipeline
– self
-
report_results:
bool
[source]¶ Whether executor should connect core services to report execution results in the end.
-
environment_definition:
EnvironmentDefinition
[source]¶ Environment definition for the execution graph.