workflow¶
The workflow model: tasks, the references between them and their order.
SplitMode
¶
Bases: StrEnum
How the pieces of a task are placed on the nodes.
Priority
¶
Bases: StrEnum
The priority of a run in the queue.
WorkflowError
¶
Bases: ValueError
A workflow which is not valid.
ResourceOverride
¶
Bases: BaseModel
Resources of a task which replace the learned or default ones.
TaskSpec
¶
Bases: BaseModel
A task of a workflow.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Identifier of the task within the workflow. |
type |
str
|
Name of the task plugin. |
settings |
dict[str, Any]
|
Settings handed to the plugin. |
inputs |
dict[str, str]
|
Input port to the output of another task, |
split |
SplitMode | None
|
Split mode of the task, the one of the workflow by default. |
resources |
ResourceOverride | None
|
Resources replacing the learned or default ones. |
stage |
list[str]
|
Input ports copied to local scratch. |
dependencies
¶
Ids of the tasks this task reads from, in input order, without repeats.
Workflow
¶
Bases: BaseModel
A workflow: tasks which read the outputs of each other.
Create a workflow, a reference error is raised as a WorkflowError.
task
¶
order
¶
Return the tasks in topological order, stable in file order.
Raises:
| Type | Description |
|---|---|
WorkflowError
|
If the references form a cycle. |
load_workflow
¶
Read a workflow from a YAML file.
Raises:
| Type | Description |
|---|---|
WorkflowError
|
If the file is not a valid workflow. |
workflow_yaml
¶
The compact YAML of a workflow: the fields which differ from the defaults.
name and tasks are always written, also when they are the defaults. A
sequence is indented below its key, as the workflows of the docs are written.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
workflow
|
Workflow
|
The workflow. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The YAML text. |