Skip to content

Commit 2413e66

Browse files
authored
Merge pull request #26 from common-workflow-language/consistent-YAML
Consistent formatting and additional array detail
2 parents 4538719 + ef6c0c0 commit 2413e66

File tree

5 files changed

+33
-18
lines changed

5 files changed

+33
-18
lines changed

_episodes/02-1st-example.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The simplest "hello world" program. This accepts one input parameter, writes a
2222
~~~
2323
{: .source}
2424

25-
Use a YAML object in a separate file to describe the input of a run:
25+
Use a YAML or JSON object in a separate file to describe the input of a run:
2626

2727
*echo-job.yml*
2828
~~~

_episodes/09-array-inputs.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,7 @@ In addition, the `itemSeperator` field, if provided, specifies that array
5454
values should be concatenated into a single argument separated by the item
5555
separator string.
5656

57-
You can specify arrays of arrays, arrays of records, and other complex
58-
types.
57+
Note that the arrays of inputs are specified inside square brackets `[]` in `array-inputs-job.yml`. Arrays can also be expressed over multiple lines, where
58+
array values that are not defined with an associated key is marked by a leading
59+
`-`, as demonstrated in the next lesson.
60+
You can specify arrays of arrays, arrays of records, and other complex types.

_episodes/10-array-outputs.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,7 @@ Final process status is success
5252
}
5353
~~~
5454
{: .output}
55+
56+
The array of expected outputs is specified in `array-outputs-job.yml` with each
57+
entry marked by a leading `-`. This format can also be used in CWL descriptions
58+
to mark entries in arrays, as demonstrated in several of the upcoming sections.

_episodes/13-expressions.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ See the [list of recommended practices][rec-practices].__
3131
~~~
3232
{: .source}
3333

34-
As this tool does not require any `inputs` we can run it with an (almost) empty job file:
34+
As this tool does not require any `inputs` we can run it with an (almost) empty
35+
job file:
3536

3637
*empty.yml*
3738

@@ -40,6 +41,10 @@ As this tool does not require any `inputs` we can run it with an (almost) empty
4041
~~~
4142
{: .source}
4243

44+
`empty.yml` contains a description of an empty JSON object. JSON objects
45+
descriptions are contained inside curly brackets `{}`, so an empty object is
46+
represented simply by a set of empty brackets.
47+
4348
We can then run `expression.cwl`:
4449

4550
~~~
@@ -51,6 +56,10 @@ Final process status is success
5156
~~~
5257
{: .output}
5358

59+
Note that requirements must be provided as an array, with each entry (in this
60+
case, only `class: InlineJavascriptRequirement`) marked by a `-`. The same
61+
syntax is used to describe the additional command line arguments.
62+
5463
You can only use expressions in certain fields. These are:
5564

5665
- `filename`

_includes/cwl/record.cwl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ inputs:
1818
prefix: -B
1919
exclusive_parameters:
2020
type:
21-
- type: record
22-
name: itemC
23-
fields:
24-
itemC:
25-
type: string
26-
inputBinding:
27-
prefix: -C
28-
- type: record
29-
name: itemD
30-
fields:
31-
itemD:
32-
type: string
33-
inputBinding:
34-
prefix: -D
21+
type: record
22+
name: itemC
23+
fields:
24+
itemC:
25+
type: string
26+
inputBinding:
27+
prefix: -C
28+
type: record
29+
name: itemD
30+
fields:
31+
itemD:
32+
type: string
33+
inputBinding:
34+
prefix: -D
3535
outputs: []
3636
baseCommand: echo

0 commit comments

Comments
 (0)