-
Notifications
You must be signed in to change notification settings - Fork 286
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
Decide what to do about standard name modifiers units #3408
Comments
From a practical point of view, the most likely usage is when a cube is copied and modified to form a template for a new cube. How about making rename check the old + new canonical units, and if they are not compatible then set the units to None (aka 'unknown').
On the other hand we do have a bit of an inconsistency in current behaviour because we dont' currently check that units are compatible with a standard name (as you pointed out). |
Agreed, but I don't think it is a simple change. I would argue that it is a breaking change and so needs to wait for Iris 3. |
I've thought a little more about this and I'm leaning more against it. As it is only possible to do this for cube's with standard_names I think it could lead to confusion if you are a user that works with both standard_names and long_names and (not necessarily aware of it).
|
Whichever way we decide to go I think this should be dropped from the 2.3 milestone due to:
|
Personally, I'd err on the side of Could we incorporate such runtime compliance checks? Yes. However I think it would be a rather large effort and maintenance overhead, and given the general wooliness of the conventions, it would lead to a lot of inevitable debate and general angst e.g., climatological time coordinates... just sayin' 😅 Naively, I say let the user do what they want, when they want with their data. Perhaps at the very least we could allow them to opt in to a form of strictness for compliance checking on save. We've always strived to have CF compliant netCDF files generated from |
As far as I can tell, the only cases where this would be relevant are for deprecated standard name modifiers so I think we can close this. |
In #3393 we included support for standard name modifiers. However, that PR, for simplicity, did not include in any special handling of the units.
In the CF Conventions Appendix C it lists the accepted Standard Name modifiers including the associated units.
u
means that the unit it is equivalent to the unit of the unmodified standard_name (e.g.northward_wind
has units ofm s-1
sonorthward_wind standard_error
would also have units ofm s-1
).Note only
status_flag
andnumber_of_observations
have specified units. Also note that both these are deprecated (See this trac ticket), although only the deprecation ofstatus_flag
appears in the actual documentation. I thinknumber_of_observations
has been missed off?The question is how to handle the units?
Should we enforce the behaviour such that if someone renames the cube from
air_temperature
->air_temperature number_of_observations
that it would also change the units?
I'm concerned this may trip some people up:
Currently with standard_name, if some renames the cube, it doesn't have any impact on the units. Below we take a wind cube and rename the cube to
air_temperature
but the units stay asm s-1
rather than converting to the canonical units ofair_temperature
The text was updated successfully, but these errors were encountered: