flowrep.converters.python_workflow_definition module
Bidirectional converter between flowrep and python-workflow-definition formats.
The python_workflow_definition (pwd) package is an optional dependency.
It represents workflows as flat, non-nested DAGs of atomic function calls with
explicit input/output nodes carrying JSON-serializable default values.
- flowrep.converters.python_workflow_definition.flowrep2pwd(wf: WorkflowRecipe, **terminal_inputs: AllowableDefaults) PythonWorkflowDefinitionWorkflow[source]
Convert a flowrep
WorkflowRecipeto python-workflow-definition.Every child of wf must be an
AtomicRecipe(the pwd format does not support nested sub-graphs). A default value must be supplied for every workflow input via terminal_inputs.- Parameters:
wf – A flat flowrep workflow (atomic children only).
**terminal_inputs – One keyword argument per workflow input, providing the JSON-serialisable default value for the corresponding PWD input node.
- Returns:
A validated
PythonWorkflowDefinitionWorkflow.- Raises:
ValueError – If any child is non-atomic, or if terminal_inputs does not exactly cover the workflow’s inputs.
- flowrep.converters.python_workflow_definition.pwd2flowrep(wf: PythonWorkflowDefinitionWorkflow) tuple[WorkflowRecipe, dict[str, AllowableDefaults]][source]
Convert a python-workflow-definition workflow to flowrep.
- Parameters:
wf – A validated PWD workflow instance.
- Returns:
A
(WorkflowRecipe, defaults)pair where defaults maps each workflow-input name to the default value carried by the corresponding PWD input node.