-
Notifications
You must be signed in to change notification settings - Fork 300
More tolerant NetCDF4 loading - skip un-addable dimensional metadata #5054
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
|
I considered similar catching for the creation of the dimensional metadata instances during NetCDF load, but working out which of the many errors would be sensible to catch would dramatically increase scope. The 16 errors during the addition step were much easier to 'audit'. |
lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test_build_ancil_var.py
Show resolved
Hide resolved
lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test_build_cell_measure.py
Show resolved
Hide resolved
stephenworsley
left a comment
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, that's some gnarly monkeypatch/mock testing but I think it covers things nicely at the unit level.
I think the main thingto add here is an integration test which demonstrates the behaviour of loading a file with these invalid coordinates. This is not entirely obvious from the loading code which is quite complex, though experiments show that these variables tend to be ignored completely rather than become their own cubes. This is in a way preferable to the current behaviour where nothing would be loaded, though it's worth considering future improvements to this behaviour which retain this information in some form. I think such improvements would be quite complicated though, so we can consider this out of scope for the time being (though it would be worth adding in a comment in the integration test stating that the behaviour tested for could be revised in future).
stephenworsley
left a comment
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.
Just a couple extra details to look at.
lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test_build_auxiliary_coordinate.py
Outdated
Show resolved
Hide resolved
lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test_build_dimension_coordinate.py
Outdated
Show resolved
Hide resolved
lib/iris/tests/unit/fileformats/nc_load_rules/helpers/test_build_dimension_coordinate.py
Outdated
Show resolved
Hide resolved
stephenworsley
left a comment
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!
🚀 Pull Request
Description
Closes #3644 (and possibly some others?).
Consult Iris pull request check list