Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: DataManagerWorkflow
kind-version: "2024.1"
name: duplicate-workflow-variable-names
description: A workflow with a duplicate variable name in the input and output
variables:
variable-mapping:
inputs:
- name: x
type: squonk/x-smiles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: DataManagerWorkflow
kind-version: "2024.1"
name: python-workflow
description: A simple python experimental workflow
variables:
variable-mapping:
inputs:
- name: candidateMolecules
type: squonk/x-smiles
Expand Down
2 changes: 1 addition & 1 deletion tests/workflow-definitions/simple-python-molprops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: DataManagerWorkflow
kind-version: "2024.1"
name: python-workflow
description: A simple python experimental workflow
variables:
variable-mapping:
inputs:
- name: candidateMolecules
type: squonk/x-smiles
Expand Down
2 changes: 1 addition & 1 deletion tests/workflow-definitions/simple-python-parallel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: DataManagerWorkflow
kind-version: "2024.1"
name: python-workflow
description: A simple branching workflow
variables:
variable-mapping:
inputs:
- name: candidateMolecules
type: squonk/x-smiles
Expand Down
2 changes: 1 addition & 1 deletion tests/workflow-definitions/workflow-options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: DataManagerWorkflow
kind-version: "2024.1"
name: workflow-options
description: Illustrate the use of workflow options
variables:
variable-mapping:
options:
- name: variableWithoutDefault
as:
Expand Down
6 changes: 3 additions & 3 deletions workflow/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def get_variable_names(definition: dict[str, Any]) -> list[str]:
outputs and options. This function DOES NOT de-duplicate names,
that is the role of the validator."""
wf_variable_names: list[str] = []
variables: dict[str, Any] | None = definition.get("variables")
variables: dict[str, Any] | None = definition.get("variable-mapping")
if variables:
wf_variable_names.extend(
input_variable["name"] for input_variable in variables.get("inputs", [])
Expand Down Expand Up @@ -112,7 +112,7 @@ def set_variables_from_options_for_step(
assert step_name

result = {}
options = definition.get("variables", {}).get("options", [])
options = definition.get("variable-mapping", {}).get("options", [])

for opt in options:
for step_alias in opt["as"]:
Expand All @@ -131,7 +131,7 @@ def get_required_variable_names(definition: dict[str, Any]) -> list[str]:
variables that are required to be defined when it is RUN - i.e.
all those the user needs to provide."""
required_variables: list[str] = []
variables: dict[str, Any] | None = definition.get("variables")
variables: dict[str, Any] | None = definition.get("variable-mapping")
if variables:
# All inputs are required (no defaults atm)...
required_variables.extend(
Expand Down
8 changes: 8 additions & 0 deletions workflow/workflow-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ properties:
items:
$ref: "#/definitions/step"
variables:
# A Job-compliant set of variable declarations for the workflow.
# This block structure is a reproduction of that used in Job definitions
# and, like JObs, has no current schema.
type: object
additionalProperties: false
variable-mapping:
# Workflow-specific variable declarations,
# used (at the moment) to map workflow variables to steps.
type: object
additionalProperties: false
properties:
Expand Down