-
Notifications
You must be signed in to change notification settings - Fork 283
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
Collapsing over a lazy auxiliary coordinate results in a netCDF4
error when the cube is saved as *.nc
file.
#4599
Comments
cheers, Manu! This looks to be direct iris-dask miscommunication issue, calling |
Changing the version of You are right; Environments: |
netCDF4
error when the cube is save as *.nc
file.netCDF4
error when the cube is saved as *.nc
file.
@bjlittle, just a heads-up that this issue probably makes us pin |
many thanks @schlunma both for raising this and for the excellent minimal code to reproduce the issue, I confirm I can reproduce it, and with the following package specs (the ones that matter):
since |
the problem occurs when
if there was a
so there are 2 identical slices but one single key to save in target, there is a duplication of slices going on somewhere - maybe you need a |
OK I kluged the problem by adding a check on def __setitem__(self, keys, arr):
if self.fill_value is not None:
self.contains_value = self.contains_value or self.fill_value in arr
if len(keys) > 1 and len(arr) == 1:
keys = keys[0]
self.is_masked = self.is_masked or ma.is_masked(arr)
self.target[keys] = arr am sure this is (very) wrong but it gives you an idea of the bit that's malfunctioning 😁 |
For what it's worth (given that @valeriupredoi already dug deeper), just printing the coordinates (points/bounds), thus making sure that EDIT: See below, I made a mistake while doing this test. When |
From Iris v3.2, coordinate points and bounds are no longer realised when you print the coordinate (see Feature 12 in the whatsnew. If you access the bounds of the collapsed "year" coordinate, the example runs OK. It doesn't seem to matter if the points stay lazy. |
have a look at this test module I wrote exactly to test the behaviour pointed out by @schlunma here, and account for cases when the coords and data are lazy or not - might even be helpful to you guys to test after you've put in the bugfix ESMValGroup/ESMValCore#1510 |
I see. Thanks for pointing out! I was redoing my test and can basically confirm what you say. Printing (realising) the coordinate bounds is enough to make it work, the coordinate points can still be lazy. |
Another change for No changes have been made to the I'll investigate further, thanks for the reproducing code ❤ |
The fix has now been released in Iris |
Great, thanks guys! |
Thanks guys!! 🎉 |
🐛 Bug Report
Collapsing a cube over a lazy auxiliary coordinate results in the following error when the cube is save as
nc
file:I tested this on two independent machines. Some additional hints:
iris=3.2.0.post0
, not foriris=3.1.0
.print(cube)
between the collapsing the thesave
somehow fixes this issue.How To Reproduce
Expected behaviour
No error, similar to
iris=3.1.0
.Environment
3.2.0.post0
Additional context
Full traceback
The text was updated successfully, but these errors were encountered: