Skip to content
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

title/descriptions for expandable parameters #370

Closed
sverhoeven opened this issue Apr 4, 2022 · 4 comments
Closed

title/descriptions for expandable parameters #370

sverhoeven opened this issue Apr 4, 2022 · 4 comments
Labels
feature New feature request yaml default parameters Anything related to the YAML configuration files for default parameters

Comments

@sverhoeven
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Expandable parameters (aka parameters in defaults.yaml files with _1 in their name) in the workflow builder app are rendered as an array of sub forms.

In the builder I generate

mol_shape:
  type: array
  items:
    default: false
    title: Is the molecule a shape?
    description: Defines a molecule as a shape.
    $comment: Defines a molecule as a shape, which is a collection of beads.
    type: boolean

from a defaults.yaml in haddock3

mol_shape_1:
  default: false
  type: boolean
  title: Is the molecule a shape?
  short: Defines a molecule as a shape.
  long: Defines a molecule as a shape, which is a collection of beads. 
  group: 'molecule'
  explevel: easy

So mol_shape.items has a title, but mol_shape itself does not.

I would like to have something like

mol_shape:
  type: array
  title: Which molecules are a shape?
  description: Defines some molecules as a shape.
  $comment: Defines some molecules as a shape.
  items:
    default: false
    title: Is the molecule a shape?
    description: Defines a molecule as a shape.
    $comment: Defines a molecule as a shape, which is a collection of beads.
    type: boolean

Currently there is no place where I can get value of mol_shape.title, mol_shape.description and mol_shape.$comment.

Describe the solution you'd like

Somewhere in the haddock3 code to define title/short/long for the parameter in its collapsed state.
This could be done as additional keys in defaults.yaml like

mol_shape_1:
  default: false
  type: boolean
  title: Is the molecule a shape?
  short: Defines a molecule as a shape.
  long: Defines a molecule as a shape, which is a collection of beads. 
  expandedtitle: Which molecules are a shape?
  expandedshort: Defines some molecules as a shape.
  expandedlong: Defines some molecules as a shape.
  group: 'molecule'
  explevel: easy

However this solution only works nicely for type 3 expandable parameters

Describe alternatives you've considered

  • For array of scalars (eg. mol_shape_1): Appending s to title of array item.
  • For array of array of objects (eg. rair_sta_1_1 + rair_end_1_1): Find overlap between titles and use that as title for array.
  • Use number field with replace (eg. nfle1.title.replace('Number of', '')), however these will disappear in fix for Handle n<param> parameter assignment logic internally? #369

Additional context
Add any other context or screenshots about the feature request here.

Below is a screenshot of the app. Instead of mol_shape I would like to show a human readable title.
localhost_3000_ (5)

@joaomcteixeira joaomcteixeira self-assigned this Apr 5, 2022
@joaomcteixeira joaomcteixeira added feature New feature request yaml default parameters Anything related to the YAML configuration files for default parameters labels Apr 5, 2022
@joaomcteixeira
Copy link
Member

Hi @sverhoeven sorry for the late reply here. Is this issue still active? Do you still need this correction/improvement? Cheers,

@rvhonorato
Copy link
Member

Almost one year later 🎂 - is this still relevant @sverhoeven ?

@sverhoeven
Copy link
Contributor Author

And another year later. the screenshot from the description is still accurate. I still would like a way to show a nicer title to the user, but need those title from here.

@sverhoeven
Copy link
Contributor Author

Implemented workaround in my catalog generation script in i-VRESSE/workflow-builder#168 at

https://github.com/i-VRESSE/workflow-builder/blob/a7e375f79f709ab1eb1487f19610c83c301fe939/packages/haddock3_catalog/generate_haddock3_catalog.py#L16-L30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request yaml default parameters Anything related to the YAML configuration files for default parameters
Projects
None yet
Development

No branches or pull requests

3 participants