Skip to content

REV: "ENH: Improved performance of PyArray_FromAny for sequences of array-like #14983

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

Merged
merged 1 commit into from
Nov 27, 2019

Conversation

charris
Copy link
Member

@charris charris commented Nov 26, 2019

See #13958.

This reverts commit 71fc59d
which was part of gh-13399 and the followup commit
ba53a63 from gh-13663.

The issue is that we mix Sequence protocol and __array__ usage
when coercing arrays.

…rray-like"

This reverts commit 71fc59d
which was part of numpygh-13399 and the followup commit
ba53a63 from numpygh-13663.

The issue is that we mix Sequence protocol and `__array__` usage
when coercing arrays. It seems easiest to revert this for the 1.17.x release
and make a larger breaking change in the 1.18.x release cycle.
Since this only occurs for stranger array-likes. This revert is limited
to the 1.17.x branch for now.
@charris charris added this to the 1.18.0 release milestone Nov 26, 2019
@charris charris changed the title REV: "ENH: Improved performance of PyArray_FromAny for sequences of a… REV: "ENH: Improved performance of PyArray_FromAny for sequences of array-like Nov 26, 2019
@h-vetinari
Copy link
Contributor

This uses the text from the OP of #14109 verbatim (AFAICT), but that is not representative of this PR (eg. milestones, branches), which is quite confusing...

@seberg
Copy link
Member

seberg commented Nov 26, 2019

I will have a look at it, the diff here suggest we may already have backported it manually? Since Matti rightliy pointed out there is a big gain here... In my branch, I started caching the __array__ (and list(...) results. But I did not finish this off, and it may look a bit different on current numpy (depends a b it on how Nathaniels feedback turns out).
That caching comes with its own issues, since users could create inconsistencies (although it is possible to add a sanity check at least). But I think it would simplify this issue because it removes the need of having 2.5 code paths doing this.

@charris
Copy link
Member Author

charris commented Nov 27, 2019

Close/reopen.

@charris charris closed this Nov 27, 2019
@charris charris reopened this Nov 27, 2019
@charris charris merged commit b491b98 into numpy:master Nov 27, 2019
@charris
Copy link
Member Author

charris commented Nov 27, 2019

Putting this in. Improvements should be made on top of this.

@seberg
Copy link
Member

seberg commented Nov 27, 2019

@charris was this actually full revision? It seems like something had gone wrong there and it only reverted the test but no other code?

@charris
Copy link
Member Author

charris commented Dec 2, 2019

Oops. Fixed up in #15027.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants