-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Bug in masked array indexing. #7493
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
Comments
Probably caused by #6094. |
@ahaldane Does this need a fix? |
It is a regression, but the question of what to do is a bit complicated. Here are the facts:
I am tempted to leave this alone until we get around to considering #6053. #6094 fixed more cases than it broke: Now all structured dtypes work properly, except structured dtypes with objects. Here is a demonstration of the assignment bug:
Maybe @astrofrog has more insights into a quick fix? |
Hmm actually there is a hack to get around the assignment bug:
That means a very hacky fix to #6094 may be to replace
|
I just did a quick rebase of #6053 on master to make sure, and it fixes it with no other changes needed. |
#6053 is bigger than I want to contemplate for 1.11.1. If you think your workaround is reasonable, could you make a special PR against 1.11.x? If not, I'm inclined to just let this problem be for 1.11 and shoot for 1.12 for the fix. |
Sure, as long as we remember to change it later. I'll try it out. |
Fixes numpy#7493, using a temporary hack, to be properly fixed later (eg with numpy#6053) Printing a Masked-Void instance broke if the instance has a field of Object dtype because assignment involving structured dtypes with objects doesn't work. Fix is to use dtype-transfer code which avoid the bug.
Fixes numpy#7493, using a temporary hack, to be properly fixed later (eg with numpy#6053) Printing a Masked-Void instance broke if the instance has a field of Object dtype because assignment involving structured dtypes with objects doesn't work. Fix is to use dtype-transfer code which avoid the bug.
This commit attempts to make structure assignment more consistent, and then changes multi-field indices to return a view instead of a copy. Assignment between structures now works "by field position" rather than "by field name". Fixes numpy#2353, fixes numpy#6085, fixes numpy#3351, fixes numpy#6085, fixes numpy#6314, fixes numpy#2346, fixes numpy#7058, fixes numpy#3641, fixes numpy#5994, fixes numpy#7262, fixes numpy#7493
This commit attempts to make structure assignment more consistent, and then changes multi-field indices to return a view instead of a copy. Assignment between structures now works "by field position" rather than "by field name". Fixes numpy#2353, fixes numpy#6085, fixes numpy#3351, fixes numpy#6085, fixes numpy#6314, fixes numpy#2346, fixes numpy#7058, fixes numpy#3641, fixes numpy#5994, fixes numpy#7262, fixes numpy#7493
Working with 0d arrays is enough here
This commit attempts to make structure assignment more consistent, and then changes multi-field indices to return a view instead of a copy. Assignment between structures now works "by field position" rather than "by field name". Fixes numpy#2353, fixes numpy#6085, fixes numpy#3351, fixes numpy#6085, fixes numpy#6314, fixes numpy#2346, fixes numpy#7058, fixes numpy#3641, fixes numpy#5994, fixes numpy#7262, fixes numpy#7493
Working with 0d arrays is enough here
This simple indexing operation
fails with a
exception. While the non-masked version just works:
Numpy version
1.11.0
on python 3.5.1 on arch linux.The text was updated successfully, but these errors were encountered: