Skip to content

Commit f6707c8

Browse files
author
Alan Christie
committed
feat: refactor definition of an output
1 parent 19e58ae commit f6707c8

13 files changed

+40
-169
lines changed

tests/test_decoder.py

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -184,41 +184,3 @@ def test_get_workflow_steps():
184184
assert len(steps) == 2
185185
assert steps[0]["name"] == "step1"
186186
assert steps[1]["name"] == "step2"
187-
188-
189-
def test_get_step_input_variable_names_when_duplicates():
190-
# Arrange
191-
workflow_filename: str = os.path.join(
192-
os.path.dirname(__file__),
193-
"workflow-definitions",
194-
"duplicate-step-input-output-variable-names.yaml",
195-
)
196-
with open(workflow_filename, "r", encoding="utf8") as wf_file:
197-
definition: Dict[str, Any] = yaml.safe_load(wf_file)
198-
199-
# Act
200-
inputs = decoder.get_step_input_variable_names(definition, "step-1")
201-
202-
# Assert
203-
assert len(inputs) == 2
204-
assert inputs[0] == "inputFile"
205-
assert inputs[1] == "inputFile"
206-
207-
208-
def test_get_step_output_variable_names_when_duplicates():
209-
# Arrange
210-
workflow_filename: str = os.path.join(
211-
os.path.dirname(__file__),
212-
"workflow-definitions",
213-
"duplicate-step-input-output-variable-names.yaml",
214-
)
215-
with open(workflow_filename, "r", encoding="utf8") as wf_file:
216-
definition: Dict[str, Any] = yaml.safe_load(wf_file)
217-
218-
# Act
219-
outputs = decoder.get_step_output_variable_names(definition, "step-2")
220-
221-
# Assert
222-
assert len(outputs) == 2
223-
assert outputs[0] == "outputFile"
224-
assert outputs[1] == "outputFile"

tests/test_workflow_engine_examples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ def test_workflow_engine_simple_python_split_combine(basic_engine):
428428
md,
429429
da,
430430
"simple-python-split-combine",
431-
{"candidateMolecules": input_file_1},
431+
{"candidateMolecules": input_file_1, "combination": "combination.smi"},
432432
)
433433

434434
# Assert

tests/test_workflow_validator_for_run_level.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -215,27 +215,3 @@ def test_validate_simple_python_molprops_with_missing_input():
215215
assert error.error_msg == [
216216
"Missing workflow variable values for: candidateMolecules"
217217
]
218-
219-
220-
def test_validate_duplicate_step_output_variable_names():
221-
# Arrange
222-
workflow_filename: str = os.path.join(
223-
os.path.dirname(__file__),
224-
"workflow-definitions",
225-
"duplicate-step-input-output-variable-names.yaml",
226-
)
227-
with open(workflow_filename, "r", encoding="utf8") as workflow_file:
228-
workflow: dict[str, Any] = yaml.load(workflow_file, Loader=yaml.FullLoader)
229-
assert workflow
230-
231-
# Act
232-
error = WorkflowValidator.validate(
233-
level=ValidationLevel.TAG,
234-
workflow_definition=workflow,
235-
)
236-
237-
# Assert
238-
assert error.error_num == 3
239-
assert error.error_msg == [
240-
"Duplicate step output variable: outputFile (step=step-2)"
241-
]

tests/test_workflow_validator_for_tag_level.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -149,27 +149,3 @@ def test_validate_simple_python_molprops_with_options():
149149
# Assert
150150
assert error.error_num == 0
151151
assert error.error_msg is None
152-
153-
154-
def test_validate_duplicate_step_output_variable_names():
155-
# Arrange
156-
workflow_filename: str = os.path.join(
157-
os.path.dirname(__file__),
158-
"workflow-definitions",
159-
"duplicate-step-input-output-variable-names.yaml",
160-
)
161-
with open(workflow_filename, "r", encoding="utf8") as workflow_file:
162-
workflow: dict[str, Any] = yaml.load(workflow_file, Loader=yaml.FullLoader)
163-
assert workflow
164-
165-
# Act
166-
error = WorkflowValidator.validate(
167-
level=ValidationLevel.TAG,
168-
workflow_definition=workflow,
169-
)
170-
171-
# Assert
172-
assert error.error_num == 3
173-
assert error.error_msg == [
174-
"Duplicate step output variable: outputFile (step=step-2)"
175-
]

tests/workflow-definitions/duplicate-step-input-output-variable-names.yaml

Lines changed: 0 additions & 44 deletions
This file was deleted.

tests/workflow-definitions/example-smiles-to-file.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ steps:
2020
- variable: smiles
2121
from-workflow:
2222
variable: smiles
23-
out:
24-
- outputFile
23+
- variable: outputFile
24+
to-project:

tests/workflow-definitions/replicate-using-undeclared-input.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ steps:
3838
from-step:
3939
name: step-1
4040
variable: outputFile
41-
out:
42-
- outputFile
41+
- variable: outputFile
42+
to-project:

tests/workflow-definitions/shortcut-example-1.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ steps:
2424
from-step:
2525
name: example-1-step-1
2626
variable: outputFile
27-
out:
28-
- outputFile
27+
- variable: outputFile
28+
to-project:

tests/workflow-definitions/simple-python-molprops-with-options.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ steps:
4141
- variable: outputFile
4242
from-workflow:
4343
variable: clusteredMolecules
44-
out:
45-
- outputFile
44+
- variable: outputFile
45+
to-project:

tests/workflow-definitions/simple-python-molprops.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ steps:
3737
- variable: outputFile
3838
from-workflow:
3939
variable: clusteredMolecules
40-
out:
41-
- outputFile
40+
- variable: outputFile
41+
to-project:

0 commit comments

Comments
 (0)