Skip to content

Conversation

@seberg
Copy link
Member

@seberg seberg commented Jan 24, 2020

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 datetime ufuncs 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.

@seberg seberg added 63 - C API Changes or additions to the C API. Mailing list should usually be notified. 07 - Deprecation labels Jan 24, 2020
@seberg seberg force-pushed the deprecate-unused-c-api branch from 5289f1c to 8596d49 Compare January 24, 2020 18:31
@seberg seberg changed the title Deprecate unused c api DEP: Schedule unused C-API functions for removal/disabling Jan 24, 2020
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PyUFunc_GenericFunction_int

Copy link
Member Author

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).

@seberg seberg force-pushed the deprecate-unused-c-api branch from 8596d49 to 52cb0cb Compare January 27, 2020 20:05
@seberg seberg force-pushed the deprecate-unused-c-api branch from 2936845 to deb8470 Compare January 30, 2020 18:19
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.
@seberg seberg force-pushed the deprecate-unused-c-api branch from deb8470 to 468ccdd Compare February 1, 2020 04:49
@mattip
Copy link
Member

mattip commented Feb 1, 2020

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.

@seberg
Copy link
Member Author

seberg commented Feb 1, 2020

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.

Copy link
Member

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.
@seberg seberg force-pushed the deprecate-unused-c-api branch from b98414e to 5ee5012 Compare February 1, 2020 23:51
@mattip mattip merged commit 330435b into numpy:master Feb 2, 2020
@mattip
Copy link
Member

mattip commented Feb 2, 2020

Thanks @seberg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

07 - Deprecation 63 - C API Changes or additions to the C API. Mailing list should usually be notified.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants