-
Notifications
You must be signed in to change notification settings - Fork 281
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
Invalid units are treated inconsistently after saving and re-loading cubes #3359
Comments
@schlunma Thanks for sharing this 👍 Round tripping should give consistent results, so let us dig deeper to determine what exactly is going on, thanks |
So what seems to be happening is that, when loading, invalid units are being stored in a cube as an attribute of the coordinate called 'invalid_units'. When saving, they are then assigned the attribute 'invalid_units' rather than 'units', which was the original attribute they were associated with. This coordinate now has no 'units' attribute, as opposed to an invalid one and is therefore treated differently when loading. The reasoning behind the current behaviour is that we will always end up saving a file which is CF compliant. This currently takes precedence over consistent loading and saving of non-CF compliant files. With that said, if there was a need for non-CF compliant information to be preserved, we could consider changing the behaviour of iris in future versions, or adding the option to preserve such information. The following options may be worth considering (ordered from major to minor changes):
|
At least some of this possibly relates to #3394 ? |
Closed by #3711. This resolves the roundtripping from cube -> NetCDF -> cube, the units on both of these will now give "unknown". |
Hey guys, I think I found a bug regarding invalid units (of coordinates).
Consider this example
That means after saving and re-loading a file with invalid coordinate units,
iris
changes theunits
. Is this behavior desired? This is not very intuitive and may prevent concatenation of newly created cubes with saved ones.The text was updated successfully, but these errors were encountered: