Repository navigation
Concatenate - #131
Concatenate#131
Conversation
|
I am not sure at all about adding Even in numpy: This function continues to be supported for backward compatibility, but you should prefer np.concatenate or np.stack. |
|
okay, then let's scrap vstack and hstack. I'll add the promote_shape mechanism tomorrow. any other suggestions for concatenate? would making it variadic be useful? otherwise i'll attempt to create |
|
I thing making it variadic is a good idea. |
|
👍 it takes multiple arguments in numpy. |
|
What I just pushed can concatenate over a tuple like this: for stack it doesn't work yet. I am interested in feedback — do you think this is a good solution or should it be handled differently? I wasn't sure if adding variadic args to concatenate works, as the axis argument would be gone (if I am not mistaken). Cheers! |
|
Notes from in-person discussions:
|
|
In my opinion, it's not too hard to write xtuple (or something along those lines) and the interface would be nice and homogenous. And then we wait for named arguments in C++ ;) |
|
Btw. was there a third point coming up? Would you keep the recursive approach for |
|
We agree with the |
|
I think a non recursive approach would be better since it would avoid many potential heap allocations. |
|
Ok! Since I've found out about apply, I think I can do it :) |
|
I'll add some working tests tomorrow. |
|
From my side this is fairly complete. For stack, all shapes have to be the same. We could also use the check_policy approach. Let me know. |
|
Also note the fix for |
|
Ok, that looks good at first sight, I'll go into details later however I think we can defer the implementation of the shape checking. This way we can merge quickly your PR and make a v0.4.2. This will help improving xtensor-python which is getting more and more attention. |
I don't remember 😕 - must have been very important :) |
|
Oh yeah I remember the third point: |
|
So |
|
I was wondering if it makes sense to have happy that it's been merged! :) |
This adds the concatenate function. I have also left vstack and hstack, but vstack is a bit limited in functionality as it's currently not possible to vstack two 1D vectors.
In another PR I'll implement the
stackfunctionality.Happy about feedback for concatenate in it's current state!