-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
decode variable with mismatched coordinate attribute #8195
Conversation
for more information, see https://pre-commit.ci
This is still draft, because I wanted to get more insight on the approach first. For now this will properly decode and propagate Some questions:
Any comments appreciated! |
This solves the problem in #1809. But I'm not really happy with the naming of |
OK, thanks to the test suite we now have a contradicting issue here: @shoyer It would be great if you can share your thoughts on how to handle mismatched coordinates here. In #313 it silently does not handle mismatched coordinates and keeps mismatched coordinates attributes on the variable. Should we just raise on mismatch (no good idea!) or keep current behaviour but issue warning (might be overlooked or disabled)? Or is there some other solution, beside the proposed by this PR? |
I think we shouldn't add more options and just silently ignore the names of any missing variables. This attribute gets out of sync quite easily.
Let's propagate if
We could warn if the coordinates attribute refers to absent variables at write time. But I suspect it would just be annoying. |
As this now does not emit any warning, should I revert the change using |
@@ -488,6 +488,10 @@ def open_dataset( | |||
as coordinate variables. | |||
- "all": Set variables referred to in ``'grid_mapping'``, ``'bounds'`` and | |||
other attributes as coordinate variables. | |||
|
|||
Only existing variables can be set as coordinates. Missing variables |
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.
I hope that this is short enough but explains how missing variables are treated. No native speaker here, so please suggest better wording/grammar.
Co-authored-by: Deepak Cherian <[email protected]>
for more information, see https://pre-commit.ci
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.
LGTM :) but could use a pass from someone else to double check our decisions
Current behaviour:
New behaviour:
|
Co-authored-by: Deepak Cherian <[email protected]>
Current behaviour (if
New behaviour (if
|
coordinates
to encoding in any casewhats-new.rst
api.rst