-
-
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
BUGFIX: deep-copy wasn't copying coords, bug fixed within IndexVariable #2936
Conversation
Tests and documentation forthcoming. I had already opened a PR, but was perplexed when the build and tests weren't passing -- suspected it was related to my commits. |
df2a875
to
f8a0569
Compare
@pletchm thanks for the PR! I think the test failuers are dependencies rather than your changes! I kicked off a build of master here: https://travis-ci.org/pydata/xarray/builds/524754660 to confirm - if it's the same failures then we'll know it's not this code |
Thanks for looking into this, @max-sixty! It looks like the errors are the same, so the problem is dependencies, right? How do we go about fixing that? |
Then it's fine! They'll be fixed separately. But did we lose the tests on this branch? Can we add those back? |
f8a0569
to
1db1673
Compare
Yep, the tests are back now. |
Perfect @pletchm ! Sorry for the test failures on our end - we had some dependency issues. I'll merge tomorrow unless anyone has other comments. |
Thanks @pletchm ! |
Can you take a look at the test failures on Windows? These seem to be due to your charge:
|
It seems xarray (mistakenly?) relies on the immutability of index data somewhere else, and hence reuses the same pandas.Index object for data in both |
Sure. I'm looking into it now. Sorry about that. |
Don't worry about it, this happens. If you can't figure out an immediate
fix, please just mark the tests as "xfail" so they don't block other PRs.
I'm pretty sure the issue here is in the tests, not your fix.
…On Thu, May 9, 2019 at 9:08 AM Martin Pletcher ***@***.***> wrote:
Sure. I'm looking into it now.
Sorry about that.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2936 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAJJFVWYEUWLGSDKNURDUWTPURD6RANCNFSM4HKLQTTQ>
.
|
@shoyer, I spent sometime looking into it and it looks like the test fails for the shallow copy, and apparently only on Windows for some reason. In Windows coords seem to be immutable unless it's one dataarray deep copied from another (which is why only the I'll open a new PR marking the tests with |
Ah, thanks @pletchm , and @shoyer for spotting this I should have caught this - I didn't separately check the windows tests; I expected the same unrelated failures as on Travis and didn't consider this would be an area that would be different between platforms. Mea culpa. It's always the avenues you least suspect... |
This pull request fixes a bug that prevented making a complete deep copy of a
DataArray
orDataset
, because thecoords
weren't being deep copied. It took a small fix in theIndexVariable.copy method
. This method now allows both deep and shallow copies ofcoords
to be made.This pull request corresponds to this issue #1463.
whats-new.rst
for all changes andapi.rst
for new API