Skip to content

Commit

Permalink
Merge pull request #26 from common-workflow-language/consistent-YAML
Browse files Browse the repository at this point in the history
Consistent formatting and additional array detail
  • Loading branch information
mr-c committed Aug 28, 2017
2 parents 4538719 + ef6c0c0 commit 2413e66
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 18 deletions.
2 changes: 1 addition & 1 deletion _episodes/02-1st-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The simplest "hello world" program. This accepts one input parameter, writes a
~~~
{: .source}

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

*echo-job.yml*
~~~
Expand Down
6 changes: 4 additions & 2 deletions _episodes/09-array-inputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,7 @@ In addition, the `itemSeperator` field, if provided, specifies that array
values should be concatenated into a single argument separated by the item
separator string.

You can specify arrays of arrays, arrays of records, and other complex
types.
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
array values that are not defined with an associated key is marked by a leading
`-`, as demonstrated in the next lesson.
You can specify arrays of arrays, arrays of records, and other complex types.
4 changes: 4 additions & 0 deletions _episodes/10-array-outputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,7 @@ Final process status is success
}
~~~
{: .output}

The array of expected outputs is specified in `array-outputs-job.yml` with each
entry marked by a leading `-`. This format can also be used in CWL descriptions
to mark entries in arrays, as demonstrated in several of the upcoming sections.
11 changes: 10 additions & 1 deletion _episodes/13-expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ See the [list of recommended practices][rec-practices].__
~~~
{: .source}

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

*empty.yml*

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

`empty.yml` contains a description of an empty JSON object. JSON objects
descriptions are contained inside curly brackets `{}`, so an empty object is
represented simply by a set of empty brackets.

We can then run `expression.cwl`:

~~~
Expand All @@ -51,6 +56,10 @@ Final process status is success
~~~
{: .output}

Note that requirements must be provided as an array, with each entry (in this
case, only `class: InlineJavascriptRequirement`) marked by a `-`. The same
syntax is used to describe the additional command line arguments.

You can only use expressions in certain fields. These are:

- `filename`
Expand Down
28 changes: 14 additions & 14 deletions _includes/cwl/record.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ inputs:
prefix: -B
exclusive_parameters:
type:
- type: record
name: itemC
fields:
itemC:
type: string
inputBinding:
prefix: -C
- type: record
name: itemD
fields:
itemD:
type: string
inputBinding:
prefix: -D
type: record
name: itemC
fields:
itemC:
type: string
inputBinding:
prefix: -C
type: record
name: itemD
fields:
itemD:
type: string
inputBinding:
prefix: -D
outputs: []
baseCommand: echo

0 comments on commit 2413e66

Please sign in to comment.