-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
API: Remove seterrobj
/geterrobj
/extobj=
and related C-API functions
#23922
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
return 0; | ||
} | ||
|
||
#undef HANDLEIT |
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.
This is a straight copy paste, the only change is making them static
.
@mattip I saw some of those unpacking non 0-d arrays into scalars in the f2py tests here also. Maybe something unrelated to the meson PR changed?! This run: https://github.com/numpy/numpy/pull/23922/checks?check_run_id=14193159921 (if it still is around) I don't think it is, so here the details:
|
cc6b782
to
c3e2e57
Compare
…perr` We could introduce a new to combine these (mainly the GetPyValues and handlefperr) and we could do so in a way that is backwards compatible: Combine both functions into one small helper. There is no known user, but if someone comes up even restoring them should be possible. These functions are threaded through our code to deal with error handling but create an unnecessary `errobj` that may have made some sense when you wish to raise errors from a worker/inner-loop. However, we never do that, and there shouldn't a be reason for downstream to do that either: The current split in functions just makes it hard to improve the `errstate` handling (because this API will not remain useful internally).
This may slow things down very slightly, but we should be able to recover this easily and the `extobj=` API is a bit strange.
These are left for now as a private implementation detail.
We will want to undo parts because eventually we probably want to fetch the "global" relatively early on once and potentially thread it through in many places. But, that refactor probably needs to touch so much, that this should make it easier anyway.
We will remove some things without deprecations, this is a category for that.
I have dropped removal of Technically, the C-API could be retained. But I still think it will make the refactor unnecessarily annoying as it will require duplicate code for only that purpose and there is no known user. |
Thanks @seberg. Nice cleanup. |
This has a couple of different commits and is unfortunately a bit large because of that. With the exception of the necessary linalg cleanup, they are rather intertwined though.
The commits should be cleanly reviewable one-by-one, though!
Not marking as draft, but the release note build may error until gh-23919 is merged.
Closes gh-23900. There were 2 👍 on the issue, so I assume/hope we have a consensus on these. Right now this is the most minimal useful version: Remove everything directly exposing
extobj
or the C-API side tuple of(ufunc_name, callable)
which is a weird indirection.EDIT: OK, removing "log" and "print" is not minimal.