Skip to content

Commit

Permalink
Rename outputMethod values
Browse files Browse the repository at this point in the history
  • Loading branch information
Iacopo Colonnelli authored and GlassOfWhiskey committed Sep 18, 2024
1 parent 72d2835 commit d22e4b4
Show file tree
Hide file tree
Showing 17 changed files with 33 additions and 32 deletions.
25 changes: 13 additions & 12 deletions Workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,8 @@ $graph:
docParent: "#LoopWorkflowStep"
doc: The loop output method, as described in [workflow step loop](#LoopWorkflowStep).
symbols:
- last
- all
- last_iteration
- all_iterations


- name: AbstractWorkflowStep
Expand Down Expand Up @@ -705,14 +705,14 @@ $graph:
The `outputMethod` field describes how to deal with loop outputs after
termination:
* **last** specifies that only the last computed element for each output
parameter should be propagated to the subsequent steps. This is the
default value.
* **last_iteration** specifies that only the last computed element for
each output parameter should be propagated to the subsequent steps.
This is the default value.
* **all** specifies that an array with all output values computed at the
end of each loop iteration should be propagated to the subsequent steps.
Elements in the array must be ordered according to the loop iterations
that produced them.
* **all_iterations** specifies that an array with all output values
computed at the end of each loop iteration should be propagated to
the subsequent steps. Elements in the array must be ordered according
to the loop iterations that produced them.
Iterative execution in CWL is an optional feature and is not required
to be implemented by all consumers of CWL documents. An implementation that
Expand All @@ -734,9 +734,9 @@ $graph:
mapPredicate: outputSource
- name: outputMethod
doc: |
If not specified, the default method is "last".
If not specified, the default method is "last_iteration".
type: LoopOutputMethod?
default: last
default: last_iteration
jsonldPredicate:
"_id": "cwl:outputMethod"
"_type": "@vocab"
Expand All @@ -748,7 +748,8 @@ $graph:
Only run the next iteration when the expression evaluates to `true`.
If the first iteration evaluates to `false` the step is skipped.
A skipped step produces a `null` on each output if the `outputMethod`
is set to `last`, and an empty array if the `outputMethod` is set to `all`.
is set to `last_iteration`, and an empty array if the `outputMethod`
is set to `all_iterations`.
- name: Workflow
Expand Down
2 changes: 1 addition & 1 deletion tests/loop/all-output-loop-no-iteration.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ steps:
when: $(inputs.i1 < 1)
loop:
i1: o1
outputMethod: all
outputMethod: all_iterations
run:
class: ExpressionTool
inputs:
Expand Down
2 changes: 1 addition & 1 deletion tests/loop/all-output-loop.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ steps:
when: $(inputs.i1 < 10)
loop:
i1: o1
outputMethod: all
outputMethod: all_iterations
run:
class: ExpressionTool
inputs:
Expand Down
2 changes: 1 addition & 1 deletion tests/loop/default-value-loop.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ steps:
i1:
outputSource: o1
default: 5
outputMethod: all
outputMethod: all_iterations
run:
class: Workflow
inputs:
Expand Down
2 changes: 1 addition & 1 deletion tests/loop/invalid-multi-source-loop-no-requirement.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ steps:
i1:
outputSource: [ osmall, obig ]
pickValue: the_only_non_null
outputMethod: all
outputMethod: all_iterations
run:
class: Workflow
inputs:
Expand Down
2 changes: 1 addition & 1 deletion tests/loop/invalid-value-from-loop-no-requirement.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ steps:
loop:
i1:
valueFrom: $(inputs.i1 + 1)
outputMethod: last
outputMethod: last_iteration
run:
class: ExpressionTool
inputs:
Expand Down
4 changes: 2 additions & 2 deletions tests/loop/loop-inside-loop-all.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ steps:
loop:
i2:
valueFrom: $(inputs.i2 + 1)
outputMethod: all
outputMethod: all_iterations
run:
class: Workflow
inputs:
Expand All @@ -38,7 +38,7 @@ steps:
when: $(inputs.i1 <= inputs.i2)
loop:
i1: o1
outputMethod: all
outputMethod: all_iterations
run:
class: ExpressionTool
inputs:
Expand Down
4 changes: 2 additions & 2 deletions tests/loop/loop-inside-loop.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ steps:
loop:
i2:
valueFrom: $(inputs.i2 + 1)
outputMethod: all
outputMethod: all_iterations
run:
class: Workflow
inputs:
Expand All @@ -34,7 +34,7 @@ steps:
when: $(inputs.i1 <= inputs.i2)
loop:
i1: o1
outputMethod: last
outputMethod: last_iteration
run:
class: ExpressionTool
inputs:
Expand Down
2 changes: 1 addition & 1 deletion tests/loop/loop-inside-scatter.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ steps:
when: $(inputs.i1 < 10)
loop:
i1: o1
outputMethod: last
outputMethod: last_iteration
run:
class: ExpressionTool
inputs:
Expand Down
2 changes: 1 addition & 1 deletion tests/loop/multi-source-loop-no-pick-value.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ steps:
i1:
outputSource: [ osmall, obig ]
valueFrom: $(self[0])
outputMethod: all
outputMethod: all_iterations
run:
class: Workflow
inputs:
Expand Down
2 changes: 1 addition & 1 deletion tests/loop/multi-source-loop.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ steps:
i1:
outputSource: [ osmall, obig ]
pickValue: the_only_non_null
outputMethod: all
outputMethod: all_iterations
run:
class: Workflow
inputs:
Expand Down
2 changes: 1 addition & 1 deletion tests/loop/single-var-loop-no-iteration.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ steps:
when: $(inputs.i1 < 1)
loop:
i1: o1
outputMethod: last
outputMethod: last_iteration
run:
class: ExpressionTool
inputs:
Expand Down
2 changes: 1 addition & 1 deletion tests/loop/single-var-loop.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ steps:
when: $(inputs.i1 < 10)
loop:
i1: o1
outputMethod: last
outputMethod: last_iteration
run:
class: ExpressionTool
inputs:
Expand Down
6 changes: 3 additions & 3 deletions tests/loop/test-index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
- job: single-var-loop-job.yml
tool: all-output-loop.cwl
id: loop_with_all_output_method
doc: "Test a loop case with outputMethod set to all"
doc: "Test a loop case with outputMethod set to all_iterations"
output:
o1: [2, 3, 4, 5, 6, 7, 8, 9, 10]
tags: [ conditional, loop, inline_javascript, workflow ]

- job: single-var-loop-job.yml
tool: all-output-loop-no-iteration.cwl
id: loop_with_all_output_method_no_iteration
doc: "Test a loop case with outputMethod set to all and a false condition"
doc: "Test a loop case with outputMethod set to all_iterations and a false condition"
output:
o1: []
tags: [ conditional, loop, inline_javascript, workflow ]
Expand Down Expand Up @@ -80,7 +80,7 @@
- job: two-vars-loop-job.yml
tool: loop-inside-loop-all.cwl
id: loop_nested_all
doc: "Test a workflow with two nested loops, both with outputMethod set to all"
doc: "Test a workflow with two nested loops, both with outputMethod set to all_iterations"
output:
o1: [[2], [2, 3], [2, 3, 4]]
tags: [ conditional, loop, inline_javascript, scatter, workflow ]
Expand Down
2 changes: 1 addition & 1 deletion tests/loop/two-vars-loop-2.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ steps:
when: $(inputs.i1 < 10)
loop:
i1: o1
outputMethod: last
outputMethod: last_iteration
run:
class: ExpressionTool
inputs:
Expand Down
2 changes: 1 addition & 1 deletion tests/loop/two-vars-loop.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ steps:
loop:
i1: o1
i2: o2
outputMethod: last
outputMethod: last_iteration
run:
class: ExpressionTool
inputs:
Expand Down
2 changes: 1 addition & 1 deletion tests/loop/value-from-loop.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ steps:
loop:
i1:
valueFrom: $(inputs.i1 + 1)
outputMethod: last
outputMethod: last_iteration
run:
class: ExpressionTool
inputs:
Expand Down

0 comments on commit d22e4b4

Please sign in to comment.