improving structured array assignment

Hello all, I've written up a tentative PR which tidies up structured array assignment, https://github.com/numpy/numpy/pull/6053 It has a backward incompatible change which I'd especially like to get some feedback on: Structure assignment now always works "by field position" instead of "by field name". Consider the following assignment:
Previously, v1 would be set to "(5,4,6)" but with the PR it is set to "(4,5,6)". This might seem like negligible improvement, but assignment "by field name" has lots of inconsistent/broken edge cases which I've listed in the PR, which disappear with assignment "by field position". The PR doesn't seem to break much of anything in scipy, pandas, and astropy. If possible, I'd like to try getting a deprecation warning for this change into 1.10. I also changed a few more minor things about structure assignment, expanded the docs on structured arrays, and made a multi-field index (arr[['f1', 'f0']]) return a view instead of a copy, which had been planned for 1.10 but didn't get in because of the strange behavior of structure assignment. Allan
participants (1)
-
Allan Haldane