-
Notifications
You must be signed in to change notification settings - Fork 59
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
⚠️ Nightly upstream-dev CI failed ⚠️ #1417
Comments
I will try to have a look but I've been out of the loop for a few months, I might need help. |
@bzah All good. We assigned you since the changes are affecting the bootstrap functions, but let us know if you need a hand / are unavailable. Thanks! |
Reopening. #1418 was dealing with a previous nightly failure. |
I'm not 100% sure yet, but it seems this PR on xarray broke our tests. rrr = rr.assign_coords(time=ind).unstack("time").stack(stack_dim=("year", "window")) What is strange is that it's only when dask is used in the tests that it breaks (see the |
I just tried to uninstall the xarray 2023.7.1.dev in favor of xarray 2023.7.0 (latest release) and the tests pass. |
I have a MRE but I still don't understand what's going on: import pandas as pd
import xarray as xr
import numpy as np
climate_var = xr.DataArray(
np.zeros(1461),
coords=[pd.date_range("2000-01-01", periods=1461, freq="D")],
dims="time",
name="tas",
)
climate_var = climate_var.chunk(dict(time=50))
rr = climate_var.rolling(min_periods=1, center=True, time=5).construct("window")
ind = pd.MultiIndex.from_arrays(
(rr.time.dt.year.values, rr.time.dt.dayofyear.values),
names=("year", "dayofyear"),
)
rr.assign_coords(time=ind).unstack("time") If the dataarray is not chunked everything works, if it is it raises:
Should we escalate this to xarray or rather dask ? |
I can throw an eye on this today! |
After the
This is strange, I'm pretty sure The investigation continues. 🕵️ |
Escalated to xarray: pydata/xarray#8039 |
<!--Please ensure the PR fulfills the following requirements! --> <!-- If this is your first PR, make sure to add your details to the AUTHORS.rst! --> ### Pull Request Checklist: - [x] This PR addresses an already opened issue (for bug fixes / features) - This PR fixes #1417 - [ ] Tests for the changes have been added (for bug fixes / features) - [ ] (If applicable) Documentation has been added / updated (for bug fixes / features) - [x] CHANGES.rst has been updated (with summary of main changes) - [x] Link to issue (:issue:`number`) and pull request (:pull:`number`) has been added ### What kind of change does this PR introduce? Overriding a coordinate with a pandas MultiIndex was not working properly before, but this didn't result in any errors up to a recent change in xarray's master. When calling `assign_coords` with a multiindex on a coordinate that already existed, the sub-indexes would not appear in the DataArray repr. In the most recent xarray master, that now triggers an error when trying to unstack the multiindex, but only if dask is used. Before, the unstacking would proceed as normal and the sub-indexes would magically appear on the result. Dropping the previous coordinate solves this problem. The next xarray will implement a new public `xr.Coordinates` class that should be used to assign coords, instead of a raw `pd.MultiIndex`. Nonetheless, overriding is still not possible and dropping the previous coordinate is still needed. ### Does this PR introduce a breaking change? No. ### Other information: See pydata/xarray#8039.
Thanks for the fix Pascal ! |
Workflow Run URL
Python 3.10 Test Summary
The text was updated successfully, but these errors were encountered: