Skip to content

Conversation

@trexfeathers
Copy link
Contributor

🚀 Pull Request

Description

Closes #3644 (and possibly some others?).


Consult Iris pull request check list

@ESadek-MO ESadek-MO requested a review from pp-mo November 9, 2022 10:10
@trexfeathers
Copy link
Contributor Author

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'.

@trexfeathers trexfeathers removed the request for review from pp-mo November 10, 2022 09:58
@trexfeathers trexfeathers changed the title More tolerance NetCDF4 loading - skip un-addable dimensional metadata More tolerant NetCDF4 loading - skip un-addable dimensional metadata Nov 10, 2022
Copy link
Contributor

@stephenworsley stephenworsley left a 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).

Copy link
Contributor

@stephenworsley stephenworsley left a 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.

Copy link
Contributor

@stephenworsley stephenworsley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@stephenworsley stephenworsley merged commit b2da2d7 into SciTools:main Nov 16, 2022
@trexfeathers trexfeathers deleted the fix_3644 branch November 29, 2022 12:22
@pp-mo pp-mo added the Dragon 🐉 https://github.com/orgs/SciTools/projects/19?pane=info label Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Dragon 🐉 https://github.com/orgs/SciTools/projects/19?pane=info

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Netcdf load should workaround unexpected names in 'coordinates'

3 participants