Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Optionals methods and pair literals #98
Conversation
| +Pair values can be specified using another Python-like syntax, as follows: | ||
| + | ||
| +``` | ||
| +Pair[Int, String] twenty_threes = (23, "twenty-three") |
ruchim
Mar 29, 2017
Contributor
not sure if the name "twenty_threes" was intentional, or it was meant to be "twenty_three"
vdauwera
Apr 1, 2017
Collaborator
Considering the Pair contains two ways to express the quantity in question, I'm going to assume it was intentionally pluralized.
cjllanwarne
Apr 3, 2017
Contributor
It's been a while since I wrote it but I'm happy to agree with @vdauwera that this is indeed a pair of twenty-threes and will therefore leave it as-is
| + | ||
| +:pig2: [Cromwell supported](https://github.com/broadinstitute/cromwell#wdl-support) :white_check_mark: | ||
| + | ||
| +Given an array of optional values, `select_all` will select the first defined value and return it. Note that this is a runtime check and you should be confident that a defined value will exist: if no defined value is found when select_first runs, the workflow will fail. |
vdauwera
Apr 1, 2017
Collaborator
"you should be confident that a defined value will exist" -> "requires that at least one defined value exists at the time the check is made" ?
| + | ||
| +:pig2: [Cromwell supported](https://github.com/broadinstitute/cromwell#wdl-support) :white_check_mark: | ||
| + | ||
| +Given an array of optional values, `select_all` will select only those elements which are defined. |
|
@vdauwera could you review this and merge if it's ready to go? This was forgotten last Cromwell release, whoops! |
| +Pair values can be specified using another Python-like syntax, as follows: | ||
| + | ||
| +``` | ||
| +Pair[Int, String] twenty_threes = (23, "twenty-three") |
vdauwera
Apr 1, 2017
Collaborator
Considering the Pair contains two ways to express the quantity in question, I'm going to assume it was intentionally pluralized.
| @@ -2488,7 +2502,7 @@ Example 2: | ||
| } | ||
| output { | ||
| - File outputFile = ${output_file_name} | ||
| + File outputFile = output_file_name |
vdauwera
Apr 1, 2017
Collaborator
Wait, is this a new syntax for outputs? And does this mean "you can write it either way" or "you have to write it the new way"?
Apologies if this was specified in release notes that I failed to read.
cjllanwarne
Apr 3, 2017
Contributor
AFAIK, this has always been the correct syntax for outputs:
output_file_nameis a variable, and you're assigning its value tooutputFile.${output_file_name}is a string interpolation that you can use inside a command block. I don't know that it would work outside a command block and would argue that it shouldn't.- You might be able to do something like
= "${output_file_name}"but this is a needless indirection. You'd be saying "insert this String into another String, and then use that". It works, but you might as well use the original String in the first place
| + | ||
| +:pig2: [Cromwell supported](https://github.com/broadinstitute/cromwell#wdl-support) :white_check_mark: | ||
| + | ||
| +Given an array of optional values, `select_all` will select the first defined value and return it. Note that this is a runtime check and you should be confident that a defined value will exist: if no defined value is found when select_first runs, the workflow will fail. |
vdauwera
Apr 1, 2017
Collaborator
"you should be confident that a defined value will exist" -> "requires that at least one defined value exists at the time the check is made" ?
cjllanwarne
was assigned
by vdauwera
Apr 1, 2017
|
Back to @cjllanwarne |
cjllanwarne
assigned vdauwera and unassigned cjllanwarne
Apr 3, 2017
|
Saw the changes of the second commit, looks beautiful |
cjllanwarne
dismissed
vdauwera’s
review
Apr 10, 2017
Changes made; not rejoined
cjllanwarne commentedMar 3, 2017
Doc changes for the upcoming Cromwell 25 release.