-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
API: Slash down errstate related API to make it sustainable #23900
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
Comments
SciPy does not use any of these but Maybe starting with |
This also requires ripping out the C-API functions They are designed in an awkward way to allow use within a ufunc inner-loop. Something that we don't do (presumably anymore). I have not found any usage of them. If people speak up with need, we (or rather they) could add the new |
Basically, the proposal is now: Remove the C-API functions and at least
Additionally, I would think it is a good idea to slash the API more, because few use it anyway:
Those changes are:
(The C-API change is in theory higher impact. But its hard to see why anyone needs to align with our machinery and we should be able to add work-arounds in the off-chance that someone complains. Plus, there are no known users, so it wouldn't matter even if it was higher impact.) EDIT: I will add removing of |
+1 for the cleanup. I would like to move to a contextvar as well |
Uh oh!
There was an error while loading. Please reload this page.
For NumPy 2.0 (or well, TBH, I think we could also pull this off in a normal release, but then I might ask for a brief NEP, because I want to jump deprecations), I would like:
seterrobj
,geterrobj
,seterrcall
,geterrcall
and the ufuncerrobj=
geterr()
andseterr()
are OK, since they take/return dicts.errstate
is preferable, but they don't matter for this. (I am OK with removing them, but I think just deprecating them is also fine.)errobj
is a weird mutable list, I don't think using it is good and I suspect it will just make fixing the errstate hard.Now the callback is probably used a couple of time in the wild, I found this: https://github.com/aglavic/genx/blob/8083fb73271f24dbf8c92433a6a86b422fefede5/genx/genx/core/custom_logging.py#L80
I think it should be fine (and backwards compatible) to ask such programs to monkey-patch
warnings.showwarning
instead.Can I get a few π for this change? :)
EDIT: Whooops, the ufunc keyword argument is called
extobj
noterrobj
, shows how much its used ;).The text was updated successfully, but these errors were encountered: