-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fixes #2198: Drop chunksizes when only when original_shape is different, not when it isn't found #2207
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
Before this fix chunksizes was dropped even when original_shape was not found in encoding
This looks good to me. Can we add a regression test to make sure we're covering the desired behavior here? Also, this warrants a note in the what's new section of the docs. |
BTW, all the tests you mention above seem to have passed on CI so I'm guessing its something to do with your environment. |
xarray/backends/netCDF4_.py
Outdated
@@ -204,7 +204,9 @@ def _extract_nc4_variable_encoding(variable, raise_on_invalid=False, | |||
chunks_too_big = any( | |||
c > d and dim not in unlimited_dims | |||
for c, d, dim in zip(chunksizes, variable.shape, variable.dims)) | |||
changed_shape = encoding.get('original_shape') != variable.shape | |||
has_original_shape = encoding.get('original_shape') is not None |
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.
'original_shape' in encoding
is a little more direct here
I just ran in to this problem and this fix works. @Karel-van-de-Plassche can you merge master please so that the tests can be rerun? Sorry for the late response here. |
Co-Authored-By: Deepak Cherian <[email protected]>
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.
This will also need a note in whats-new.rst
Thanks @Karel-van-de-Plassche |
Before this fix chunksizes was dropped even when
original_shape was not found in encoding
Four seemingly unrelated tests failed