Skip to content
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

fix: support arbitrary ufuncs with respect to NEP-50 #2799

Merged
merged 7 commits into from
Nov 6, 2023

Conversation

agoose77
Copy link
Collaborator

@agoose77 agoose77 commented Nov 6, 2023

This PR takes into consideration the failure of Numba ufuncs in our NEP-50 aware machinery. It's unfortunate that this has taken a subsequent PR, but in retrospect we should have duck-typed this from the beginning.

Now, we just ask the ufunc object if it supports NEP-50 via resolve_dtypes. In future, we should gracefully support Numba's implementation, assuming that it implements this in a similar way to NumPy, which it ought to.

Our test suite will fail once Numba >=0.59.0 is available, because we can't know for certain what kind of exception it will throw. Thus, we'll catch that at the time and implement the correct exception handler in pytest.

Copy link

codecov bot commented Nov 6, 2023

Codecov Report

Merging #2799 (3092be6) into main (40ca1b2) will increase coverage by 0.01%.
The diff coverage is 66.66%.

Additional details and impacted files
Files Coverage Δ
src/awkward/_nplikes/array_module.py 86.02% <95.00%> (+1.95%) ⬆️
src/awkward/_nplikes/typetracer.py 74.94% <51.35%> (+0.02%) ⬆️

@agoose77
Copy link
Collaborator Author

agoose77 commented Nov 6, 2023

Hmm, test fails on Windows. Let me perhaps choose some different types to avoid the 32-bit aspect to this. I'll use a typed np.generic scalar ~np.int16

Ah, as I suspected this is actually the default int type, not int64
@agoose77 agoose77 changed the title fix: support arbtirary ufuncs with respect to NEP-50 fix: support arbitrary ufuncs with respect to NEP-50 Nov 6, 2023
@agoose77 agoose77 merged commit 4609b58 into main Nov 6, 2023
36 checks passed
@agoose77 agoose77 deleted the agoose77/fix-arbitrary-dtypes-nep-50 branch November 6, 2023 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant