MAINT: use new dtype in view creation rather than going through two views#31271
MAINT: use new dtype in view creation rather than going through two views#31271seberg merged 1 commit intonumpy:mainfrom
Conversation
c051800 to
3487318
Compare
|
@seberg - I've adapted this follow-up, where just one view is done for the "standard in the future" path. Note that I got carried away a bit in my reorganization of the code, which makes the difference view rather poor. You may want to just look at the file directly... (I do think it has become clearer as a result, in particular by just putting the path of the future first...) |
|
Nice, so this "just" re-organizes the double view. I'll have a look, moves things around, but I think otherwise I'll probably just put it in unless I find an issue. (I have a "more complete fix (TM)" for the deprecation, almost lined up, but might just put this in and rebase. it's a bit ridiculous and of course nothing is really 100%, but considering how important the |
e6533c0 to
d1f2b1c
Compare
|
MacOS / Accelerate warning would seem unrelated... |
d1f2b1c to
21828a3
Compare
|
@seberg - sorry, looking at it again, I felt I could clean up the addition a bit more, so I did... Should now be truly ready for final review. |
seberg
left a comment
There was a problem hiding this comment.
A few small nits I'll just apply. Thanks.
…iews. This includes moving the new dtype checking stuff to common.c and use that in dtype setting as well.
21828a3 to
e751d28
Compare

EDITED since now follow-up rather than an alternative to #31234.
This PR lets
PyArray_View()do a one-step view of both a possibly new subtype and a new dtype. To avoid duplicated checks on the dtype, I factored out that piece of the internal_set_dtype.No AI was used.