-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
parameter and step groups #35
Comments
Groups should have a field called "expanded" (default true) which indicates if the group is expanded in the UI by default. Groups should be displayed after any non-grouped items. |
I think this is an important issue. I agree that groups are necessary for UI applications. My personal preference would be the first syntax suggestion. I believe the second option could be a bit confusing to work with. |
Here is an example of option one as an extension $namespaces:
cwltool: "http://commonwl.org/cwltool#"
inputs:
parameter1: string
parameter2: int
hints:
cwltool:Groups:
groups:
group1:
groupMembers: [parmeter1, parameter2]
doc: "parameters related to the foobar feature" Example of loading this using from pathlib import Path
from cwl_utils.parser import load_document_by_uri
from cwl_utils.utils import normalize_to_map
cwl_file = Path("echo-groups.cwl")
cwl_obj = load_document_by_uri(cwl_file)
if cwl_obj.hints:
hints = normalize_to_map(cwl_obj.hints, key_field="class")
if 'cwltool:Groups' in hints:
print(hints['cwltool:Groups'])
# {'groups': {'my_groups': {'groupMembers': ['first', 'second'], 'label': 'my great inputs', 'doc': 'parameters related to the foobar feature'}}} |
@t0mdavid-m I updated the example in #35 (comment) to use the new syntax |
Open question from a discussion with @mvdbeek is or are there 3 top level entries, |
New idea for the native (non-extension) syntax: specifying directly as part of the inputs:
first_input: int
advanced_params:
type: group
doc: "Advanced parameters related to the foobar feature"
members:
parameter1: string
parameter2: int
other_input: File Using a |
👎 this seems very awkward.
I think we do want to this, but for a different reason: for schema-salad to generically validate cross-references, we need to at least distinguish between steps and parameters, and if we fix the naming collision between inputs/outputs in the future (by prefixing the ids that get assigned) then we'll also need separate inputGroups and outputGroups. Revised proposal:
|
Yes, that is good, but there is a (reasonable, in my opinion) user request to preserve the order of inputs or outputs between the YAML file and any UI interface that is made using them. Regardless if those inputs/outputs are in a group or not. |
Why? Because of the fake |
I think I misunderstood the proposal. What you're saying is that the input parameters are
Using the proposed sequence syntax and adding in
This does feel a bit easier to understand for the end user. On the other hand, embedding groups into the input definition like this means it is no longer an external annotation. This means both the validation code and any code that walks over the list of inputs has to be able to handle groups. So it is a much bigger change for implementers. (which is why the original proposal defined groups separately). |
With this fake "type: group", will we need to change anything in Schema Salad to ensure a single namespace for all the inputs, regardless of their group? |
Want to be able to apply annotations to groups of parameters or workflow steps. This would principally be metadata documentation -- need to decide if this should include features that affect runtime execution or not. The goal is to have a way to provide better documentation & user interface for tool use.
Syntax options:
Discussion points
The text was updated successfully, but these errors were encountered: