-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
BUG: retain writeable flag when indexing subclasses #4843
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
Conversation
fixes failures of pyfits with numpy 1.9, see astropy/astropy#2693 @seberg are there more indexing cases where this could be broken? |
ind = np.array([0, 1]) | ||
assert_(d[ind].flags.writeable) | ||
assert_(d[...].flags.writeable) | ||
assert_(d[True].flags.writeable) |
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.
The d[True]
raises a DeprecationWarning that causes the test to fail.
/home/charris/.local/lib/python2.7/site-packages/numpy/core/records.py:459: DeprecationWarning: using a boolean instead of an integer will result in an error in the future
The easy fix is to remove the check or use an integer.
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.
fixed
BUG: retain writeable flag when indexing subclasses
Thanks Julian. I think we are about ready for the second beta. Are there any other PR's that you want to get in? |
I think #4840 would still be good |
I'd also like to know whats going on in #4836 but I can't reproduce it, I guess I could install a intel compiler .. |
There are still three numpy related errors in sklearn 0.14, but they are fixed in 0.15.0b2, so I think we are OK there. |
Sorry, was travelling a bit today, as noted in the other PR, I think this would be better:
|
I reverted this and applied your patch for testing. It fails one of Julians tests:
It works for the integer indexing, but the boolean case looks to be a problem. |
you need to apply it in both places I applied my fix too, don't know why I didn't see that ._. |
@juliantaylor I step outside and you beat me to it ;) |
Applying this
Does fix it. Should I make a PR for this? Seems right to me. |
Hmmm, probably coul duse a goto_wrap_array in the boolean case too, instead of doing it by hand inside the boolean assignment code. A bit more elegant, I didn't expect it necessary in both cases ;). But yes, seems right to me too. |
No description provided.