-
-
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
Subtracting datasets in xarray 2024.6.0 leads to inconsistent chunks #9267
Comments
Thanks for opening your first issue here at xarray! Be sure to follow the issue template! |
Ah this is my mistake, we need to loop over variable and chunk them individually here: Lines 706 to 713 in ad35a10
|
What is your issue?
When I call
groupby()
on a dataset and try to subtract another dataset from the result, I get an error that saysValueError: Object has inconsistent chunks along dimension lead. This can be fixed by calling unify_chunks().
Adding a call to unify chunks beforehand resolves the issue, but for some strange reason this chunking issue only occurs with more recent versions of xarray. When I run the same code below with
xarray 2022.3.0
, I can run the same code without calling unify chunks. Does anyone know what may have caused the discrepency?Here's the relevant section of code I was running when I encountered the problem. in the snippet below, the
members
variable is a list of paths to netcdf files that contain the output from an ensemble of ocean models. I think the error should be reproducible with any group of netcdf files and similar operations:And here's the output from
xarray.show_version()
:The text was updated successfully, but these errors were encountered: