Skip to content

generic numpy.ufunc #88

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

Closed
jorenham opened this issue Feb 7, 2025 · 0 comments · Fixed by #231
Closed

generic numpy.ufunc #88

jorenham opened this issue Feb 7, 2025 · 0 comments · Fixed by #231

Comments

@jorenham
Copy link
Member

jorenham commented Feb 7, 2025

Currently, all ufuncs are basically untyped, accepting everything and returning Any. The numpy._typing._ufunc type-check-only "subtypes" are hacks that somewhat ease the pain. But a better solution is needed, and numpy._typing._ufunc should be removed entirely.

In NumPy, the .nin in {1, 2}, and .nout <= {1, 2}. But in SciPy (scipy.special) has .nin in {1, 2, 3, 4, 5} (some private ones have 7) and .nout in {1, 2, 4}. So the numpy.ufunc type should be flexible enough to allow nin>2 and nout>2. See scipy/scipy-stubs#27 for details on the scipy.special ufuncs.

@jorenham jorenham changed the title Generic numpy.ufunc generic numpy.ufunc Feb 7, 2025
@jorenham jorenham self-assigned this Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant