-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
NEP 15: Merging multiarray and umath #10704
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
NEP 15: Merging multiarray and umath #10704
Conversation
Cycling PR to attempt to fix circleci weirdness. |
f01a609
to
49592ab
Compare
I'd like to just merge this, but then there is no place for discussion. What process is proposed for updating/discussing NEP proposals? |
There's a greater evil than |
There is a similar dichotomy with |
My understanding there is that |
OTOH, numpy.linalg.lapack_lite contains non-ufunc wrappers for a few
LAPACK routines. I guess the only reason for its existence is that the
work for porting those to gufuncs was not done yet.
|
have internal API that's visible to everything inside the same | ||
extension module, or you can have a public API that everyone can use; | ||
you can't have an API that's visible to multiple extension modules | ||
inside numpy, but not to external users. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not an argument against doing this NEP -- but there would be nothing stopping you from having two PyCapsule tables -- one for the public ABI and the other for private. Both would be technically public and some bad actors would use and come to rely on the private, but it would be easier to say 'told you so' to those folks.
``numpy/core/src/private/``, which now contains a bunch of files which | ||
are ``#include``\d twice, once into ``multiarray`` and once into | ||
``umath``. This is pretty gross, and is purely a workaround for these | ||
being separate C extensions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npymath is also included in both extension modules.
#10703 has been merged, is there anything blocking this from a merge? |
but we can make one or both of these modules be tiny shims that simply | ||
re-export the magic API object from where-ever it's actually defined. | ||
(See ``numpy/core/code_generators/generate_{numpy,ufunc}_api.py`` for | ||
details of how these imports work.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a requirement that we still have c-extension modules named numpy.core.{umath, multiarray}
or can they be pure python wrappers around the single c-extension module (call it numpy.core._multiarray
)? Can't the _ARRAY_API
and _UFUNC_API
be exported from the same shared object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing prevents pure-python wrapper files iiuc.
4c4716e
to
3ef1431
Compare
Note to self: still need to add this to index.rst, but maybe better to
wait until after #10703 is merged.