-
-
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
Raise error when assigning to IndexVariable.values & IndexVariable.data #3862
Conversation
Great, good spot @dcherian |
OK to merge @dcherian ? We can almost release 0.15.1 then |
I think @shoyer should confirm that this is what we want to do |
this causes the docs to fail: Line 660 in 0722b42
|
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.
Looks good to me, thanks!
* upstream/master: add spacing in the versions section of the issue report (pydata#3876) map_blocks: allow user function to add new unindexed dimension. (pydata#3817) Delete associated indexes when deleting coordinate variables. (pydata#3840) remove macos build while waiting for libwebp fix (pydata#3875) Fix html repr on non-str keys (pydata#3870) Allow ellipsis to be used in stack (pydata#3826) Improve where docstring (pydata#3836) Add DataArray.pad, Dataset.pad, Variable.pad (pydata#3596) Fix some warnings (pydata#3864) Feature/weighted (pydata#2922) Fix recombination in groupby when changing size along the grouped dimension (pydata#3807) Blacken the doctest code in docstrings (pydata#3857) Fix multi-index with categorical values. (pydata#3860) Fix interp bug when indexer shares coordinates with array (pydata#3758) Fix alignment with join="override" when some dims are unindexed (pydata#3839)
I think the failed tests are unrelated since they only fail on the
|
I think now that you merged #3874, if you re-merge master they should pass. |
* upstream/master: Re-enable tests xfailed in pydata#3808 and fix new CFTimeIndex failures due to upstream changes (pydata#3874)
Great. Thanks all. Now to find out how many downstream projects test against master on CI :) |
* upstream/master: (54 commits) Limit repr of arrays containing long strings (pydata#3900) expose a few zarr backend functions as semi-public api (pydata#3897) Use drawstyle instead of linestyle in plot.step. (pydata#3274) Implementation of polyfit and polyval (pydata#3733) misplaced quote in whatsnew (pydata#3889) Rename ordered_dict_intersection -> compat_dict_intersection (pydata#3887) Control attrs of result in `merge()`, `concat()`, `combine_by_coords()` and `combine_nested()` (pydata#3877) xfail test_uamiv_format_write (pydata#3885) Use `fixes` in PR template (pydata#3886) Tweaks to "how_to_release" (pydata#3882) whatsnew section for 0.16.0 Release v0.15.1 whatsnew for 0.15.1 (pydata#3879) update panel documentation (pydata#3880) reword the whats-new entry for unit support (pydata#3878) Raise error when assigning to IndexVariable.values & IndexVariable.data (pydata#3862) Re-enable tests xfailed in pydata#3808 and fix new CFTimeIndex failures due to upstream changes (pydata#3874) add spacing in the versions section of the issue report (pydata#3876) map_blocks: allow user function to add new unindexed dimension. (pydata#3817) Delete associated indexes when deleting coordinate variables. (pydata#3840) ...
@dcherian @max-sixty is there a reason why this change wasn't incorporated into |
I'm not quite sure what you mean here. That's exactly what this change does, making assignment to If you were mutating Unfortunately we couldn't figure out another way to make this work -- see #3470 (comment) for discussion. We're definitely open to alternatives if you can come up with them, though! |
Sorry, I got a bit criss-crossed between this PR and the thread in #3470. In light of #3470 (comment) it seems like the next best thing would be to given |
There's no need to use ds['time'] = new_values # good
ds.coords['time'] = new_values # good
ds.coords['time'].values = new_values # broken, disabled by this PR
ds.coords['time'].values[:] = new_values # also buggy (but harder to disable) This would probably be worth clarifying in the error message. (Under the hood, |
Ah! Nice! Yeah the error message led me to believe that there was no path for in-place updates. |
This addresses a breaking change in xarray=0.15.1 (see pydata/xarray#3862).
isort -rc . && black . && mypy . && flake8
whats-new.rst
for all changes andapi.rst
for new API