-
-
Notifications
You must be signed in to change notification settings - Fork 11.9k
DEP: Schedule unused C-API functions for removal/disabling #15427
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
Conversation
5289f1c to
8596d49
Compare
numpy/core/src/umath/ufunc_object.c
Outdated
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.
PyUFunc_GenericFunction_int
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.
Would have liked to claim it was on purpose to proof that really nobody uses it ;). Waiting for mailing list replies, but my guess is, nobody will really care (at least if I read your reply as "OK with some reservations", Chuck).
8596d49 to
52cb0cb
Compare
2936845 to
deb8470
Compare
The function has no known usage outside of NumPy. It is fairly complex to use due to how it behaves with scalars, and, at least with a given "flexible" dtype would require additional access to the private PyArray_AdaptFlexibleDType function. Removing the function from public API will simplify refactor work of the dtype and dimension recovery.
This function provides mainly the same API as PyObject_Call() with the exception of skipping ufunc overrides and output array wraps. It is fairly unwieldy to use, since ownership of all inputs and outputs is transferred, but otherwise it still uses args and kwargs as inputs. As such, no known usage exists and PyObject_Call seems a reasonable replacement for possible usage. Keeping it around means that we would may have to add tests or risk breaking this function when ufunc code is refactored.
This function is currently undocumented. It is not used in NumPy and seems useless outside of NumPy. This is due to the fact that user datatypes are not actually capable of leveraging this function! They are stored in a different way, so that their loops cannot be identified by an index.
deb8470 to
468ccdd
Compare
|
Do you still want to add tests for these? I guess we don't need a release note since the claim is that the functions are unused. |
|
I am not particularly in love with adding tests, all they would do is see the warning is correct. But I am happy to do this if anyone prefers. Forgot about release notes, can't hurt, added them. |
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.
unused and have been deprecated.
If you can say what the other API functions are in two words that would be nice
These functions are believed to be unused, or at least largely unused.
b98414e to
5ee5012
Compare
|
Thanks @seberg |
This deprecates three functions which I believe are unlikely to have any use case outside NumPy. My current hope is that we can remove these (and plausibly more) immediately after a 1.19 release and manage to put in a large hunk of dtype changes than.
The last function was not even documented, and is pretty much useless, unless possibly for someone writing
datetimeufuncs outside of NumPy.I probably need to add tests for this ;), and will ping the mailing list. I will admit that none of the functions are completely unreasonable to expose, but their implementation details seem to expose unnecessary complexity at this time.