Re: Do special functions need to have all kwargs/attributes/methods of ufuncs?

Albert Steppi <[email protected]> Thu, 21 Sep 2023 11:27:25 -0400
Newsgroups gmane.comp.python.scientific.devel
Message-ID <CAPceVpWKrL+YNeDfYTY=Lr90quxibTtat005Uz-+NM+EpMpJNA@mail.gmail.com>
>
> But it works today?
>
> ```
> In [1]: import numpy as np
>
> In [2]: import scipy.special as special
>
> In [3]: isinstance(special.erf, np.ufunc)
> Out[3]: True
>
> In [4]: isinstance(special.ndtr, np.ufunc)
> Out[4]: True
>

Sorry, you need to set `export SCIPY_ARRAY_API=1`, to put the dispatch to
alternative backends in place. As things currently stand, ndtr, erf, and
some others, will be replaced with functions which dispatch to a given
backend depending on the type of the input.

On Thu, Sep 21, 2023 at 03:35 Evgeni Burovski <[email protected]>
wrote:

> > On Wed, Sep 20, 2023 at 10:33 PM Albert Steppi <[email protected]>
> wrote:
> >>
> >> I think making something like isinstance(special.ndtr, np.ufunc) work
> would require some pretty ugly hackery, so I'd prefer to at least break
> this.
>
> But it works today?
>
> ```
> In [1]: import numpy as np
>
> In [2]: import scipy.special as special
>
> In [3]: isinstance(special.erf, np.ufunc)
> Out[3]: True
>
> In [4]: isinstance(special.ndtr, np.ufunc)
> Out[4]: True
> ```
> _______________________________________________
> SciPy-Dev mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/mailman3/lists/scipy-dev.python.org/
> Member address: [email protected]
>

_______________________________________________
SciPy-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/scipy-dev.python.org/
Member address: [email protected]