Skip to content

Warn in Combine plugin for new variable name not matching CF conventions - #2419

Open
mo-robert-purvis wants to merge 2 commits into
metoppv:masterfrom
mo-robert-purvis:Cube-combiner-warn-about-new-var-name-not-starting-with-letter
Open

Warn in Combine plugin for new variable name not matching CF conventions#2419
mo-robert-purvis wants to merge 2 commits into
metoppv:masterfrom
mo-robert-purvis:Cube-combiner-warn-about-new-var-name-not-starting-with-letter

Conversation

@mo-robert-purvis

@mo-robert-purvis mo-robert-purvis commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

The cube_combiner.py plugin Combine allows for a new name to be given to the variable in the combined cube. It will allow for one that doesn't conform to the CF conventions on variable names (https://cfconventions.org/Data/cf-standard-names/docs/guidelines.html) - allowing a name starting with a digit. An invalid variable name will subsequently be silently modified by iris with var_ added as a prefix.

This change to IMPROVER will add a warning to inform that the variable name is contrary to the CF naming conventions, and that Iris will add a prefix to the name. The new_name value is not modified - simply warned about.

The output of this message is as a user warning, e.g.:
UserWarning: improver.api.Combine during execution: The new variable name (10m_ratio_wind_speed_of_gust) does not start with a letter, and so is contrary to the CF convention for variable names. Iris will add 'var_' as a prefix to it.

Testing:

  • Ran unit tests and they passed OK
  • Tested with an application that uses the Combine plugin and sets a new_name argument starting with a digit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant