-
-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Description
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:
- Delete any weird "log" and "callback" stuff from the errobj/errstate
- Remove
seterrobj,geterrobj,seterrcall,geterrcalland the ufuncerrobj=- I would add an error on the last one with a note that we are willing to accept patches to restore some of its behavior if there is a real need. I don't hate allowing passing this state in, but I think it should evolve (and probably have a new name).
geterr()andseterr()are OK, since they take/return dicts.errstateis 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 not errobj, shows how much its used ;).