-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
BUG, MAINT: concatenate of empty sequences, fixes #1586 #7450
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
Conversation
Hmm... I'm wondering if this isn't one of those functions that would look better in Cython? We already have an |
That would be a simple method of moving things to Cython, and I guess speed wise probably fine. I have difficulties to get an idea of how much this specific code would be simplified. One thing that I always think could be very useful, would be if there was nditer/NpyIter aware code generation. The new iterator is pretty convoluted to set up, but I guess for that to be really useful, we have to trust fused types and I seem to remember there were some limitations to them, though maybe they are cleared up and I have used them before. |
|
☔ The latest upstream changes (presumably #8584) made this pull request unmergeable. Please resolve the merge conflicts. |
Empty non-arrays no longer participate in determining the dtype of the result. Have also refactored the code quite a bit, unifying the flattened and multidim branches wherever possible, as well as the error checks. Also a handful of new tests, including both the bug fixed and existing untested functionality.
c950966
to
3b9f052
Compare
☔ The latest upstream changes (presumably #8894) made this pull request unmergeable. Please resolve the merge conflicts. |
Sorry to keep creating conflicts here! Also, the commit message prefix is missing an I |
What does this PR think about: np.concatenate([np.array([], float), np.array([1, 2], int)]).dtype I think we want the answer to be |
Closing. The new tests pass except for Eric's comment about Please reopen if it should be |
(#1586)
Empty non-arrays no longer participate in determining the dtype of
the result.
Have also refactored the code quite a bit, unifying the flattened
and multidim branches wherever possible, as well as the error checks.
Also a handful of new tests, including both the bug fixed and
existing untested functionality.