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
open_dataset with engine='zarr' changed from '2023.8.0' to '2023.9.0' #8269
Comments
Thanks for opening your first issue here at xarray! Be sure to follow the issue template! |
Thanks @mps01060, that's most likely a regression when checking the We've had several changes for time/timedelta encoding in 2023.09.0. I'm trying to get behind it and issue a fix. |
I was a bit too fast here, as the decoding can't be the source: Timedeltas Lines 859 to 863 in d5f1785
Datetimes Lines 824 to 828 in d5f1785
|
It's not directly related to time decoding, but in the attempt to preserve nanosecond resolution we've added some code to CFMaskCoder to special handle time-like data. And yes, it's currently only checked if there are specifc time related strings in the units: xarray/xarray/coding/variables.py Lines 218 to 230 in 2cd8f96
|
What is your issue?
When moving from xarray version '2023.8.0' to '2023.9.0' the behavior of importing a zarr changed for me (code to create example zarr at end of this post). When importing a variable with units "days accumulated", the values are scaled differently between the two versions. The latest version seems to automatically treat this as as time-like array (I think the -9.223372e+18 seen are NaT-like?).
Open the zarr:
Print as a pandas-like table for each version of xarray for readability:
Version '2023.8.0':
Version '2023.9.0':
I can manually disable this by using the "use_cf=False", "mask_and_scale=False", and then manually scale this variable, though that is not ideal. The "decode_timedelta" doesn't seem to have an effect on this data, either.
I understand the "days" keyword is in my units, however the full unit is "days accumulated". Has the behavior of xarray changed to find keywords such as "days" occurring anywhere in the units (eg. as a substring)? Do you have any other suggestions? Thank you for the help.
Code to create the debug.zarr for the tables above:
The text was updated successfully, but these errors were encountered: