MetOffice / CSET

Toolkit for evaluation and investigation of numerical models for weather and climate applications.
https://metoffice.github.io/CSET/
Apache License 2.0
14 stars 5 forks source link

Improve how variables are passed through to avoid quoting issues #730

Open jfrost-mo opened 5 months ago

jfrost-mo commented 5 months ago

What problem does your feature request solve?

Currently a lot of issues arise from various shells interpreting the variables to be put into the templates. This is confusing, and hard to get right, so should be improved.

Describe the solution you'd like

Ideally nothing between rose edit and CSET should be parsing these values, so we should probably encode them somehow and then send them across directly. Maybe JSON encoding, or something else?

Describe alternatives you've considered

Much pain.

jfrost-mo commented 4 months ago

While I hoped to fix this upstream in Cylc, for various reasons that solution is not viable. A good suggestion did come up however: https://github.com/cylc/cylc-flow/issues/6202#issuecomment-2222304635

The easiest solution is probably to use an env-script:

[runtime]
  [[mytask]]
    env-script = """
      export ENV_VAR_TEMPLATE1='foo_${BAR}_baz'
      export ENV_VAR_TEMPLATE2='pub_${QUX}'
    """
    script = rose task-run