-
Notifications
You must be signed in to change notification settings - Fork 283
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
Handling of Standard name aliases #5257
Comments
C.f. #5255, which mentions the creation of |
Hey @larsbarring thanks for raising this. We need to have a think about the implications of what you're suggesting, so leave it with us and hopefully we'll get back to you asap 👍 |
Replacing the names outright without user intervention seems like an extreme approach. More prefereable would be a utility which promotes these names and perhaps a warning when such names are loaded to suggest this to a user. Does this seem like a reasonable approach? |
I agree 👍 Either a utility, or perhaps a kwarg to the iris.load functions: something like
|
I'd say that the key place to issue warnings would be on save |
Well, iris as such might not use the standard name much, but as users of iris api we might be interested in this and appreciate not having to deal with alias (that might evolve over time) or get an warning that if one is aiiased. But I admit that this is somewhat speculative/forward-looking as I do no have an immediate hands-on use case. |
Just by complete chance, when looking for something else, I came across this use case for handling aliases in a more sophisicated way than what is now the case. |
@SciTools/peloton considering what is possible, according to the statement here in the CF FAQ We may need to be pragmatic, since the suggestion is that older aliases can be ambiguous, in which case an automatic translation is simply not always possible. Also we have concerns that automatic standard-name translation on load is a bit "dangerous" in breaking user code, since the same code loading the same data would produce cubes with different names on an Iris / standard-name-table upgrade. Another thought : in keeping with recent decisions, we might prefer to control loading via a content manager than add keywords (but it's only a style thing). In view of that, and above comments, can you come up with an implementation proposal for enhanced load and save behaviours (or utility) @larsbarring ? |
In fact I have been playing with some ideas during the last couple of days (as always very much limited by pretty basic [pun intended] coding skills):
|
And when again reading your comment @pp-mo, I think that you hit the nail when writing
I totally agree and this was my motivation for asking for standard name version information (#5255). And regarding upgrading the standard name table, I was asking myself whether this could be done more dynamically. I.e. if there was an |
If we had the dictionary of aliases, it would be pretty easy to provide a callback function that renames the cubes. If the dictionary was public then users could use it to create their own callback functions, which would give maximum flexibility. |
✨ Feature Request
When Iris is installed the file
lib/std_names.py
is generated from the xml version of the standard name table. In this process all aliased standard names are "promoted" to become on par with the all other standard names.Wouldn't it be more appropriate to have them replaced by the corresponding new standard names? I.e. that Iris can read/understand the aliased standard names, but translating them to the new ones which then are used in further processing and when writing data.
Motivation
To my understanding the idea behind aliasing a standard name is that the new standard name better/more precisely describes the quantity at hand, perhaps even taking new research results into account.
The text was updated successfully, but these errors were encountered: