-
Notifications
You must be signed in to change notification settings - Fork 8
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
RFC: rm __array__, add __buffer__ #115
base: main
Are you sure you want to change the base?
Conversation
The matching SciPy PR: scipy/scipy#22189 |
df7b4d1
to
4fcb9e6
Compare
4fcb9e6
to
a821bb9
Compare
The current behavior: On python 3.12:
On python 3.11:
|
a821bb9
to
8115901
Compare
Otherwise, on python 3.11 and below, np.array(array_api_strict_array) becomes a 0D object array.
8115901
to
ede45af
Compare
6961ee7
to
45befd6
Compare
PSA: The timeline for this PR is "land in a couple of month's time". The current thinking is that short-term we work on the 2024.12 support in version 2.3, let the dust settle, and then merge this PR. Downstream testing with |
Try getting rid of
__array__
, replace with the buffer protocol's__buffer__
.cross-ref #67, #69
This does not seem to fix gh-102.
scipy
tests pass locally.Replacing
__array__
with__buffer__
makes code marginally simpler. Effectively bumps the python requirement to 3.12+ though.So maybe this is a temp solution until
dlpack
matures.¯\_(ツ)_/¯