ENH: Add an out argument to concatenate#9209
Conversation
eric-wieser
left a comment
There was a problem hiding this comment.
Arguably we might now want a casting argument as well
There was a problem hiding this comment.
Only real change here is this if statement
There was a problem hiding this comment.
And this if statement
There was a problem hiding this comment.
And here we just redirect the old API to not break compatibility
909b411 to
b7bee01
Compare
|
Seems pretty useful to me. There are definitely times where I've wanted to do such an operation and resorted to doing it by hand in a loop over a statement like Code LGTM. |
b7bee01 to
670e5b4
Compare
|
Tests and release note added. I've left out I'll leave |
670e5b4 to
a8a4045
Compare
|
Rebased to fix release note clashes. @ahaldane, good to merge? |
There was a problem hiding this comment.
incidentally, this is the only place in numpy this function is used.
For a second I thought there might be some problem that we ignore strides when out is provided, like in #7633, but it's fine, PyArray_AssignArray below is insensitive to order.
There was a problem hiding this comment.
Yeah, I assume this is an optimization
There was a problem hiding this comment.
I remember this function being new in 1.7 or so, somewhat thought it was used with the new iterator, but maybe there was some change there (since I also remember there was a some bug with this or its usage). The idea is simple though, find the cache friendliest iteration order....
|
The tests need to be reworked, not sure what happened to Code LGTM again. Also, we might use the new priority function in #9672 too. Actually, a lot of the the |
a8a4045 to
0228ebf
Compare
|
Fixed to use |
|
OK, will merge this soon too. |
|
Merging, thanks Eric |
|
oh, sorry, the page just refreshed and there's a release note conflict you need to fix. |
|
Ok, merged through the web interface, since rebasing causes a mess due to the |
|
Thanks for the quick fix, merging for real now. |
Useful for: