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

Error using a period within Cylc cyling task names #775

Closed
jwarner8 opened this issue Aug 5, 2024 · 4 comments
Closed

Error using a period within Cylc cyling task names #775

jwarner8 opened this issue Aug 5, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@jwarner8
Copy link
Contributor

jwarner8 commented Aug 5, 2024

Describe the bug

Many recipes involving looping over variables or model levels to produce numerous plots. If we are iterating over values that include periods, etc. model half levels [0.5,1.5,2.5], parsing these values and creating a unique tasks in the Cylc workflow causes an error and the workflow fails to validate. This is because tasks would be named, for example, plot_[var]_[modellev] would become plot_airtempertaure_0.5.

A possible solution for floats would be to parse '.' as 'p', etc. 0.5 -> 0p5. I can't think of any cases where variable names would involve periods,

How to reproduce

Steps to reproduce the behaviour:

Expected behaviour

Environment

  • Version: [e.g. from cset --version]
  • Browser (if UI issue): [e.g. Chrome, Firefox]
@jwarner8 jwarner8 added the bug Something isn't working label Aug 5, 2024
@jwarner8
Copy link
Contributor Author

jwarner8 commented Aug 6, 2024

Testing solution which uses jinja2 parsing, etc.
{% set level = 1.2 %}
{% set formatted_level = level|string|replace('.', 'p') %}

@jfrost-mo
Copy link
Member

One of my questions for the cylc surgery this afternoon is what characters are allowed in task names. After that, replacing invalid characters sounds like a sensible plan.

@jfrost-mo
Copy link
Member

The allowed task names are documented here: https://cylc.github.io/cylc-doc/stable/html/user-guide/writing-workflows/runtime.html#cylc.flow.unicode_rules.TaskNameValidator

@jfrost-mo
Copy link
Member

Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants