-
Notifications
You must be signed in to change notification settings - Fork 279
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
POC: Handle std names and aliases (#5257) #5313
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5313 +/- ##
==========================================
- Coverage 89.31% 89.19% -0.13%
==========================================
Files 89 90 +1
Lines 22375 22430 +55
Branches 5368 5383 +15
==========================================
+ Hits 19985 20007 +22
- Misses 1640 1670 +30
- Partials 750 753 +3 ☔ View full report in Codecov by Sentry. |
cf-convention/discuss#229 Standard names: hard to spot "typo" in `surface_upward_mass_flux_of_methane_due_to_emission_from_fires`
* new optional argument -d/--descr for including standard name descriptions * including the description of all standard names * including standard name table version and related info. * now contains several variables: - variables (starting with underscore) used in the processing - VERSION (dict) - CONVENTIONS_STRING (str) - STD_NAME (dict) - ALIASES (dict) - optionally DESCRIPTION (dict) harmonize quotation marks to single quotes in description string
57fed3f
to
d2216e7
Compare
@SciTools/peloton is this still alive issue, and if so could you sign the CLA @larsbarring ? |
I thought I had already signed the CLA because of one or two previous minor contributions. Anyway, now done. Whether it is alive or not I am not sure. I have not made any further effort since back then as I am not sure whether it is a reasonable approach in the context of Iris. |
Ok thanks!
Well, I guess we'll take a look + see about it |
Yes, I think that this would still be useful. In the context of CF an aliased standard name is typically regarded as deprecated. Software should be able to read data having an aliased standard name, but new data should use the replacement name. Obviously, there are judgements to be made here regarding how to deal with this in practice. But and aliased standard name should not be considered just as an alternative at the same level as standard name. Also, note that there will likely be some minor changes to the standard name xml file format as of next version, possibly also backported to all previous versions. |
A proper way to handle standard name aliases would also be useful for ESMValTool, see ESMValGroup/ESMValCore#1985. One issue we currently face is merging cubes with different standard names, which is (in the current iris version) not even allowed if the standard names are aliases of each other. |
@LisaBock this may be of interest to you. |
🚀 Pull Request
Description
This is a "proof-of-concept" PR to address how to better handle standard name aliases. It consists of the following elements:
tools/generate_std_names.py
).It now includes some table version information (mentioned in CF global attribute "Conventions": expose to users, and include CF standard name table version #5255), and a separate dict for the standard name descriptions (optional when generated).
get_convention
-- return a tentative Conventions stringset_alias_processing
-- define how to handle aliases:"keep" - current behaviour, treat aliases in the same way as currently valid standard names,
"warn" - issue a warning (default), otherwise as "keep",
"replace" - silently update aliases to current standard names.
get_description
-- return the standard name description if availablecheck_valid_standard_name
-- check if a name is a standard name or an alias, and do the translation if requested as defined byset_alias_processing
iris.__init__
common/mixin._get_valid_standard_name
is modified to usecheck_valid_std_name
No units test have been added (would be good to first get some feedback whether this POC is a reasonable approach .... )
Consult Iris pull request check list