-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
BUG: structured array indexing dtype and dtype.descr changed in 1.14.0 #10387
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
It appears there is one there, yes. But there is also one either in SciPy (dealing with empty field names) or NumPy (the addition of an empty field name) that is breaking |
OK, I'm back. And ugh, this is (in part) an ancient outstanding bug, #3176 (also #2215) which has now become easier to run across because of the changes from #6053. The old problem from #3176 is that #3176 has been on my "structured type" TODO list. My idea was to get the consistent structured type behavior settled first in #6053, and only then move on to "details" like the load/save implementation. But maybe we can't do that. |
For now do we want to provide a mechanism to copy a structured array into a contiguous dtype, at the cost of reordering fields? The save function could just do this 8000 internally and warn |
That seems like a pretty reasonable solution. Better than reverting #6053 imo, and a lot easier than trying to fix #3176, which I think will be tricky since it is enmeshed with the PEP3118 issues we found for structured types. Actually maybe we should define a new public function somewhere called |
Another option:
I'd prefer something that operates on the dtype, not the array |
While it sounds like the
In parallel with the fixes proposed here that will address the |
Fixes numpy#10387 Fixes numpy#10344 Fixes numpy#10409
Fixes numpy#10387 Fixes numpy#10344 Fixes numpy#10409
Fixes numpy#10387 Fixes numpy#10344 Fixes numpy#10409
Fixes numpy#10387 Fixes numpy#10344 Fixes numpy#10409
@ahaldane This is fixed for 1.14, correct? |
I just rebuilt the latest 1.14.x branch, and can confirm that all outputs of my script are as they were on 1.13:
And that I'm happy to give it a try on 1.15.0 once #10411 is in if it helps. |
Running this code on 1.13.x and 1.14.0 yields different outputs:
On 1.13.x the output is consistent -- for all four print statements it gives:
On 1.14.x it changes to these, the first of which is now dict-like, the second (
descr
) has a new field('', '|V8')
, the third (round-trip IO) changesdtype
back to a list, and the fourth (descr
) changes the blank field name to''
:The real reason I found this bug is because the addition of the blank field name breaks
scipy.io.savemat
:If these structured dtype changes are intentional and not bugs, I can open a SciPy issue instead (which would either be to avoid writing void data, or write out unknown fields).
The text was updated successfully, but these errors were encountered: