New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple output formats #901
Comments
Hello @fmigneault That's great to hear that you are mapping WPS to CWL! As you know, the format field in the With the later, a CWL tool description author can dynamically set the output format based upon input parameters, some output of the program itself, or by passing through the As you have noted, the dynamic Ideally, the authors of CWL CommandLineTool descriptions would not be in this place to start with. Here are two techniques they can use to avoid this situation:
For the situation where one wants to pass through an input format (the "JSON in -> JSON out" example), that can be reasoned with prior to execution of the entire workflow (in the best case) or just before execution of the CommandLineTool (why run a step if you know the next step won't accept the input). For this situation I don't feel that an extension to the CWL standards is needed. Your request for a way to list potential formats could be a nice enhancement, perhaps an optional field As a workaround, you can add format verification in the You have an additional request to automatically assign the While researching this response, I discovered that |
@mr-c There is one case that I would like to validate. If I got an input array of Files with format defined as an array of possible formats, and |
Good question! I just discovered that we don't strongly specify if #!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: CommandLineTool
requirements:
InlineJavascriptRequirement: {}
inputs:
main_inputs:
type: File[]
format: [iana:text/plain, iana:text/xml]
inputBinding:
position: 0
default:
- class: File
basename: a
format: iana:text/plain
contents: |
A
- class: File
basename: b
format: iana:text/xml
contents: |
B
baseCommand: cat
outputs: []
$namespaces: { iana: https://www.iana.org/assignments/media-types/ } The above does not produce an error with As for
So it seems that in CWL v1.0.x and v1.1, that Also, if If you are okay with assuming all members of a |
Yes, this seems to be the same conclusion I came to. On my side, when I obtain a multi-format and/or array-type output on WPS, I have to drop the corresponding CWL format because there is no way to allow an array of different formats, and I cannot assume one of the potential input multi-format provided. Thanks for the validation 👍 |
Hi, I am aware of #482 where outputs have been limited explicitly to only a single format.
I have more of a question regarding that decision.
I do not understand why it is critical that an output cannot have multiple potential formats.
Say, you have an app that takes as input
--format = YAML|JSON
, which produces the correspondingoutput.json
oroutput.yml
. Then, the format validation should be able to handle either of the corresponding IANA references.Definitely, the actual output can have only 1 format within the potential ones, and if none is matched the process is invalid, but this should be a runtime validation/restriction, and not a limitation of the CWL definition. For matching, the output format, it could be done using simple extension matches or more advanced parser/schema validator. This is what we do on WPS (example docs) that I'm trying to map with CWL functionalities.
Thanks in advance for insights.
The text was updated successfully, but these errors were encountered: