-
Notifications
You must be signed in to change notification settings - Fork 296
PI-3473: Netcdf loading ancillary variables #3556
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
Conversation
|
||
self.assertCML(cubes, ("netcdf", "netcdf_cell_methods.cml")) | ||
|
||
def test_ancillary_variables(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might also be worthwhile also testing for cell measures. As far as I can tell, they aren't currently being tested for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I've convinced myself this treats cell measures and ancillaries in a way that is consistent with current treatment of coordinates. Just a couple very minor things to look at for tidiness sake.
attr_units = get_attr_units(cf_cm_var, attributes) | ||
|
||
data = _get_cf_var_data(cf_cm_attr, engine.filename) | ||
data = _get_cf_var_data(cf_cm_var, engine.filename) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, should this have a comment similar to this line?
iris/lib/iris/fileformats/_pyke_rules/fc_rules_cf.krb
Lines 2018 to 2019 in 1178de7
# Get (lazy) content array | |
data = _get_cf_var_data(cf_av_var, engine.filename) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but "consistency" is a bit of a lost cause in this code IMHO. Not least because we have far too much code duplication code, as here !
( N.B. We do still hope to replace all of this with Python code #3415 )
coord.var_name: coord.standard_name or coord.var_name or "unknown" | ||
for coord in cube.coords() | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there still be whitespace here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I suppose so.
I might have hoped that Black would take care of this, but clearly the results are not totally standardised ..
* Revert to single-line command for doctr invocation. * Added script comment, partly to force Github respin.
Thanks @stephenworsley |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, just one more small change needed.
lib/iris/tests/test_netcdf.py
Outdated
my_areas:custom = "extra-attribute"; | ||
data: | ||
axv = 11, 12, 13; | ||
ayv = 21, 22, 23; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ayv
should be length 2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
I'm surprised it didn't error that!
Hi @stephenworsley |
@pp-mo Looks good. I think this just needs rebasing to make Travis pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, ready to merge!
* _regrid_area_weighted_array: Tweak variable order to near other use in code (SciTools#3571) * Fix problems with export and echo command. (SciTools#3577) * Pushdocs fix2 (SciTools#3580) * Revert to single-line command for doctr invocation. * Added script comment, partly to force Github respin. * Added whatsnew for Black. (SciTools#3581) * Fixes required due to the release of iris-grib v0.15.0 (SciTools#3582) * Fix python-eccodes pin in travis (SciTools#3593) * Netcdf load of ancillary vars: first working.
… launch_ancils * 'launch_ancils' of https://github.com/SciTools/iris: Resolve conflicts with requirements/test.txt to update the imagehash pin to imagehash>=4.0 (SciTools#3735) PI:3358 (WIP) Ensure flags load/save without units (SciTools#3613) PI-3473 Rename "engine.provides" (SciTools#3590) PI-3473: Whatsnews relating to ancillary load + save. (SciTools#3557) PI-3473: Netcdf loading ancillary variables (SciTools#3556) � Conflicts: � lib/iris/fileformats/netcdf.py � lib/iris/tests/unit/fileformats/netcdf/test__load_aux_factory.py � requirements/core.txt
Load ancils for netcdf.
STATUS: why this targets the 'launch_ancils' feature branch
We aren't yet sure that we will be ready to "release" ancillary variables in Iris 3.0
(mostly because there are a lot of places where specific handling is needed to avoid creating bad cubes).
Hence this is the key PR on the launch_ancils feature branch.
In practice, some support has already been merged to master.
Especially #3422, which also already makes the cube API for ancils visible.
However.. bad things don't happen until cubes contain ancils, which will generally only happen to users when we merge this PR, following which they can be generated when loading.
Likewise, we are also "holding back" on other PRs, targetting the feature branch instead of master), e.g. documentation additions
NOTES: