Skip to content
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

special ufunc type signature #27

Closed
41 tasks done
jorenham opened this issue Sep 6, 2024 · 3 comments · Fixed by #375
Closed
41 tasks done

special ufunc type signature #27

jorenham opened this issue Sep 6, 2024 · 3 comments · Fixed by #375
Assignees
Labels
scipy.special stubs: improvement Improve or refactor existing annotations

Comments

@jorenham
Copy link
Owner

jorenham commented Sep 6, 2024

The majority of the scipy.special functions are numpy.ufunc (230 / 356 ~= 64.6%).
But the numpy.ufunc isn't generic, making most of the type signatures in scipy.special maximally loose, i.e. (*args, **kwds) -> object.

In NumPy's bundled stubs, there's a workaround that uses typ-check-only ufunc "subtypes" for each of the possible nin and nargs combinations (at most nin=2 and nout=2).
We apply a similar approach, but more specific to each of the type signatures.

ufunc properties

  • __name__
  • nin
  • nout
  • nargs
  • ntypes
  • types
  • identity
  • signature

ufunc methods

  • __call__
  • at
  • reduce
  • accumulate
  • reduceat
  • outer

ufunc types (signatures)

  • 46 {'f->f', 'd->d'}
  • 3 {'f->f', 'd->d', 'g->g'}
  • 17 {'f->f', 'd->d', 'F->F', 'D->D'}
  • 1 {'F->F', 'D->D'}
  • 2 {'ld->d'}
  • 42 {'ff->f', '(l|d)d->d'}
  • 4 {'fF->F', 'dD->D'}
  • 19 {'ff->f', 'dd->d', 'fF->F', 'dD->D'}
  • 3 {'ff->f', 'dd->d', 'FF->F', 'DD->D'}
  • 44 {'fff->f', '(l|d)(l|d)d->d'}
  • 3 {'fff->f', '(l|d)dd->d', 'ffF->F', 'ddD->D'}
  • 3 {'fff->f', 'ddd->d', 'FFF->F', 'DDD->D'}
  • 5 {'ffff->f', 'dddd->d'}
  • 1 {'(qq|ff)ff->F', '(qq)dd->D'} (sph_harm)
  • 3 {'ffff->f', '(l|d)ddd->d', 'fffF->F', 'dddD->D'}
  • 1 {'ffff->f', 'dddd->d', 'FFFF->F', 'DDDD->D'}
  • 4 {'f->ff', 'd->dd'}
  • 2 {'f->FF', 'd->DD'}
  • 3 {'f->ff', 'd->dd', 'F->FF', 'D->DD'}
  • 3 {'ff->ff', 'dd->dd'}
  • 6 {'fff->ff'. 'ddd->dd'}
  • 6 {'ffff->ff', 'dddd->dd'}
  • 6 {'fffff->ff', 'ddddd->dd'}
  • 1 {'f->ffff', 'd->dddd'}
  • 1 {'f->FFFF', 'd->DDDD'}
  • 2 {'f->ffff', 'd->dddd', 'F->FFFF', 'D->DDDD'}
  • 1 {'ff->ffff', 'dd->dddd'}
@jorenham jorenham mentioned this issue Sep 6, 2024
@jorenham jorenham added the stubs: improvement Improve or refactor existing annotations label Sep 7, 2024
@jorenham jorenham changed the title Dealing with numpy.ufunc numpy.ufunc 🤔 Oct 9, 2024
@jorenham jorenham added the meta: codegen Automatically generated code label Oct 18, 2024
@jorenham jorenham pinned this issue Oct 18, 2024
@jorenham jorenham unpinned this issue Oct 21, 2024
@jorenham jorenham changed the title numpy.ufunc 🤔 annotating the ufuncs in scipy.special Oct 21, 2024
@jorenham jorenham self-assigned this Oct 24, 2024
@jorenham
Copy link
Owner Author

The scipy.special ufuncs come in 11 different (nin, nout) flavors (scipy==1.14.1):

nin nout nargs count
1 1 2 68
2 1 3 70
3 1 4 50
4 1 5 10
1 2 3 9
2 2 4 3
3 2 5 6
4 2 6 6
5 2 7 6
1 4 5 4
2 4 6 1

Note that nargs == nin + nout.


The number of types (i.e. ntypes) ranges between 1 and 5, and there are also 5 possible (individual) return types:

np.single | np.double | np.longdouble | np.csingle | np.cdouble

Which is (almost always) equivalent to

np.float32 | np.float64 | np.longdouble | np.complex64 | np.complex128

The dtype of the input must have the following scalar type:

np.long | np.single | np.double | np.longdouble | np.csingle | np.cdouble

(on numpy<2 the np.long should be replaced with np.int_)

Which is (almost always) equivalent to

np.long | np.float32 | np.float64 | np.longdouble | np.complex64 | np.complex128

long is almost always int32 on windows and 32-bits unix-like platforms, and int64 on 64-bits linux


These are the 233 scipy.special ufuncs and their signatures:

  • bei:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • beip:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • ber:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • berp:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • cbrt:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • cosdg:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • cosm1:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • cotdg:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • dawsn:
    • (f4, /) -> f4
    • (f8, /) -> f8
    • (c8, /) -> c8
    • (c16, /) -> c16
  • ellipe:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • ellipk:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • ellipkm1:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • entr:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • erf:
    • (f4, /) -> f4
    • (f8, /) -> f8
    • (c8, /) -> c8
    • (c16, /) -> c16
  • erfc:
    • (f4, /) -> f4
    • (f8, /) -> f8
    • (c8, /) -> c8
    • (c16, /) -> c16
  • erfcinv:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • erfcx:
    • (f4, /) -> f4
    • (f8, /) -> f8
    • (c8, /) -> c8
    • (c16, /) -> c16
  • erfi:
    • (f4, /) -> f4
    • (f8, /) -> f8
    • (c8, /) -> c8
    • (c16, /) -> c16
  • erfinv:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • exp1:
    • (f4, /) -> f4
    • (f8, /) -> f8
    • (c8, /) -> c8
    • (c16, /) -> c16
  • exp10:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • exp2:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • expi:
    • (f4, /) -> f4
    • (f8, /) -> f8
    • (c8, /) -> c8
    • (c16, /) -> c16
  • expit:
    • (f8, /) -> f8
    • (f4, /) -> f4
    • (g, /) -> g
  • expm1:
    • (f4, /) -> f4
    • (f8, /) -> f8
    • (c8, /) -> c8
    • (c16, /) -> c16
  • exprel:
    • (f8, /) -> f8
    • (f4, /) -> f4
  • gamma:
    • (f8, /) -> f8
    • (c16, /) -> c16
    • (f4, /) -> f4
    • (c8, /) -> c8
  • gammaln:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • gammasgn:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • i0:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • i0e:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • i1:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • i1e:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • it2struve0:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • itmodstruve0:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • itstruve0:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • j0:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • j1:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • k0:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • k0e:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • k1:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • k1e:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • kei:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • keip:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • ker:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • kerp:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • kolmogi:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • kolmogorov:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • log1p:
    • (f4, /) -> f4
    • (f8, /) -> f8
    • (c8, /) -> c8
    • (c16, /) -> c16
  • log_expit:
    • (f8, /) -> f8
    • (f4, /) -> f4
    • (g, /) -> g
  • log_ndtr:
    • (f4, /) -> f4
    • (f8, /) -> f8
    • (c8, /) -> c8
    • (c16, /) -> c16
  • loggamma:
    • (f8, /) -> f8
    • (c16, /) -> c16
    • (f4, /) -> f4
    • (c8, /) -> c8
  • logit:
    • (f8, /) -> f8
    • (f4, /) -> f4
    • (g, /) -> g
  • ndtr:
    • (f4, /) -> f4
    • (f8, /) -> f8
    • (c8, /) -> c8
    • (c16, /) -> c16
  • ndtri:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • ndtri_exp:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • psi:
    • (f8, /) -> f8
    • (c16, /) -> c16
    • (f4, /) -> f4
    • (c8, /) -> c8
  • psi:
    • (f8, /) -> f8
    • (c16, /) -> c16
    • (f4, /) -> f4
    • (c8, /) -> c8
  • rgamma:
    • (f8, /) -> f8
    • (c16, /) -> c16
    • (f4, /) -> f4
    • (c8, /) -> c8
  • round:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • sindg:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • spence:
    • (f4, /) -> f4
    • (f8, /) -> f8
    • (c8, /) -> c8
    • (c16, /) -> c16
  • tandg:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • wofz:
    • (c8, /) -> c8
    • (c16, /) -> c16
  • wrightomega:
    • (f4, /) -> f4
    • (f8, /) -> f8
    • (c8, /) -> c8
    • (c16, /) -> c16
  • y0:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • y1:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • zetac:
    • (f4, /) -> f4
    • (f8, /) -> f8
  • agm:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • beta:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • betaln:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • binom:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • boxcox:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • boxcox1p:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • chdtr:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • chdtrc:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • chdtri:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • chdtriv:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • ellipeinc:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • ellipkinc:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • elliprc:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
    • (c8, c8, /) -> c8
    • (c16, c16, /) -> c16
  • eval_chebyc:
    • (i8, f8, /) -> f8
    • (f4, f4, /) -> f4
    • (f4, c8, /) -> c8
    • (f8, f8, /) -> f8
    • (f8, c16, /) -> c16
  • eval_chebys:
    • (i8, f8, /) -> f8
    • (f4, f4, /) -> f4
    • (f4, c8, /) -> c8
    • (f8, f8, /) -> f8
    • (f8, c16, /) -> c16
  • eval_chebyt:
    • (i8, f8, /) -> f8
    • (f4, f4, /) -> f4
    • (f4, c8, /) -> c8
    • (f8, f8, /) -> f8
    • (f8, c16, /) -> c16
  • eval_chebyu:
    • (i8, f8, /) -> f8
    • (f4, f4, /) -> f4
    • (f4, c8, /) -> c8
    • (f8, f8, /) -> f8
    • (f8, c16, /) -> c16
  • eval_hermite:
    • (i8, f8, /) -> f8
  • eval_hermitenorm:
    • (i8, f8, /) -> f8
  • eval_laguerre:
    • (i8, f8, /) -> f8
    • (f4, f4, /) -> f4
    • (f4, c8, /) -> c8
    • (f8, f8, /) -> f8
    • (f8, c16, /) -> c16
  • eval_legendre:
    • (i8, f8, /) -> f8
    • (f4, f4, /) -> f4
    • (f4, c8, /) -> c8
    • (f8, f8, /) -> f8
    • (f8, c16, /) -> c16
  • eval_sh_chebyt:
    • (i8, f8, /) -> f8
    • (f4, f4, /) -> f4
    • (f4, c8, /) -> c8
    • (f8, f8, /) -> f8
    • (f8, c16, /) -> c16
  • eval_sh_chebyu:
    • (i8, f8, /) -> f8
    • (f4, f4, /) -> f4
    • (f4, c8, /) -> c8
    • (f8, f8, /) -> f8
    • (f8, c16, /) -> c16
  • eval_sh_legendre:
    • (i8, f8, /) -> f8
    • (f4, f4, /) -> f4
    • (f4, c8, /) -> c8
    • (f8, f8, /) -> f8
    • (f8, c16, /) -> c16
  • expn:
    • (i8, f8, /) -> f8
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • gammainc:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • gammaincc:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • gammainccinv:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • gammaincinv:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • hankel1:
    • (f4, c8, /) -> c8
    • (f8, c16, /) -> c16
  • hankel1e:
    • (f4, c8, /) -> c8
    • (f8, c16, /) -> c16
  • hankel2:
    • (f4, c8, /) -> c8
    • (f8, c16, /) -> c16
  • hankel2e:
    • (f4, c8, /) -> c8
    • (f8, c16, /) -> c16
  • huber:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • hyp0f1:
    • (f4, f4, /) -> f4
    • (f4, c8, /) -> c8
    • (f8, f8, /) -> f8
    • (f8, c16, /) -> c16
  • inv_boxcox:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • inv_boxcox1p:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • iv:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
    • (f4, c8, /) -> c8
    • (f8, c16, /) -> c16
  • ive:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
    • (f4, c8, /) -> c8
    • (f8, c16, /) -> c16
  • jv:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
    • (f4, c8, /) -> c8
    • (f8, c16, /) -> c16
  • jv:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
    • (f4, c8, /) -> c8
    • (f8, c16, /) -> c16
  • jve:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
    • (f4, c8, /) -> c8
    • (f8, c16, /) -> c16
  • kl_div:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • kn:
    • (i8, f8, /) -> f8
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • kv:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
    • (f4, c8, /) -> c8
    • (f8, c16, /) -> c16
  • kve:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
    • (f4, c8, /) -> c8
    • (f8, c16, /) -> c16
  • mathieu_a:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • mathieu_b:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • modstruve:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • owens_t:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • pdtr:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • pdtrc:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • pdtri:
    • (i8, f8, /) -> f8
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • pdtrik:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • poch:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • powm1:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • pseudo_huber:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • rel_entr:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • smirnov:
    • (i8, f8, /) -> f8
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • smirnovi:
    • (i8, f8, /) -> f8
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • stdtr:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • stdtridf:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • stdtrit:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • struve:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • tklmbda:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • xlog1py:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
    • (c8, c8, /) -> c8
    • (c16, c16, /) -> c16
  • xlogy:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
    • (c8, c8, /) -> c8
    • (c16, c16, /) -> c16
  • yn:
    • (i8, f8, /) -> f8
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
  • yv:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
    • (f4, c8, /) -> c8
    • (f8, c16, /) -> c16
  • yve:
    • (f4, f4, /) -> f4
    • (f8, f8, /) -> f8
    • (f4, c8, /) -> c8
    • (f8, c16, /) -> c16
  • bdtr:
    • (f4, f4, f4, /) -> f4
    • (f8, i8, f8, /) -> f8
    • (f8, f8, f8, /) -> f8
  • bdtrc:
    • (f4, f4, f4, /) -> f4
    • (f8, i8, f8, /) -> f8
    • (f8, f8, f8, /) -> f8
  • bdtri:
    • (f4, f4, f4, /) -> f4
    • (f8, i8, f8, /) -> f8
    • (f8, f8, f8, /) -> f8
  • bdtrik:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • bdtrin:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • besselpoly:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • betainc:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • betaincc:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • betainccinv:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • betaincinv:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • btdtria:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • btdtrib:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • chndtr:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • chndtridf:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • chndtrinc:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • chndtrix:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • elliprd:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
    • (c8, c8, c8, /) -> c8
    • (c16, c16, c16, /) -> c16
  • elliprf:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
    • (c8, c8, c8, /) -> c8
    • (c16, c16, c16, /) -> c16
  • elliprg:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
    • (c8, c8, c8, /) -> c8
    • (c16, c16, c16, /) -> c16
  • eval_gegenbauer:
    • (i8, f8, f8, /) -> f8
    • (f4, f4, f4, /) -> f4
    • (f4, f4, c8, /) -> c8
    • (f8, f8, f8, /) -> f8
    • (f8, f8, c16, /) -> c16
  • eval_genlaguerre:
    • (i8, f8, f8, /) -> f8
    • (f4, f4, f4, /) -> f4
    • (f4, f4, c8, /) -> c8
    • (f8, f8, f8, /) -> f8
    • (f8, f8, c16, /) -> c16
  • fdtr:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • fdtrc:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • fdtri:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • fdtridfd:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • gdtr:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • gdtrc:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • gdtria:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • gdtrib:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • gdtrix:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • hyp1f1:
    • (f4, f4, f4, /) -> f4
    • (f4, f4, c8, /) -> c8
    • (f8, f8, f8, /) -> f8
    • (f8, f8, c16, /) -> c16
  • hyperu:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • log_wright_bessel:
    • (f8, f8, f8, /) -> f8
    • (f4, f4, f4, /) -> f4
  • lpmv:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • nbdtr:
    • (i8, i8, f8, /) -> f8
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • nbdtrc:
    • (i8, i8, f8, /) -> f8
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • nbdtri:
    • (i8, i8, f8, /) -> f8
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • nbdtrik:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • nbdtrin:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • nctdtr:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • nctdtridf:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • nctdtrinc:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • nctdtrit:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • nrdtrimn:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • nrdtrisd:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • obl_cv:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • obl_cv:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • radian:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • voigt_profile:
    • (f4, f4, f4, /) -> f4
    • (f8, f8, f8, /) -> f8
  • wright_bessel:
    • (f8, f8, f8, /) -> f8
    • (f4, f4, f4, /) -> f4
  • elliprj:
    • (f4, f4, f4, f4, /) -> f4
    • (f8, f8, f8, f8, /) -> f8
    • (c8, c8, c8, c8, /) -> c8
    • (c16, c16, c16, c16, /) -> c16
  • eval_jacobi:
    • (i8, f8, f8, f8, /) -> f8
    • (f4, f4, f4, f4, /) -> f4
    • (f4, f4, f4, c8, /) -> c8
    • (f8, f8, f8, f8, /) -> f8
    • (f8, f8, f8, c16, /) -> c16
  • eval_sh_jacobi:
    • (i8, f8, f8, f8, /) -> f8
    • (f4, f4, f4, f4, /) -> f4
    • (f4, f4, f4, c8, /) -> c8
    • (f8, f8, f8, f8, /) -> f8
    • (f8, f8, f8, c16, /) -> c16
  • hyp2f1:
    • (f8, f8, f8, f8, /) -> f8
    • (f8, f8, f8, c16, /) -> c16
    • (f4, f4, f4, f4, /) -> f4
    • (f4, f4, f4, c8, /) -> c8
  • ncfdtr:
    • (f4, f4, f4, f4, /) -> f4
    • (f8, f8, f8, f8, /) -> f8
  • ncfdtri:
    • (f4, f4, f4, f4, /) -> f4
    • (f8, f8, f8, f8, /) -> f8
  • ncfdtridfd:
    • (f4, f4, f4, f4, /) -> f4
    • (f8, f8, f8, f8, /) -> f8
  • ncfdtridfn:
    • (f4, f4, f4, f4, /) -> f4
    • (f8, f8, f8, f8, /) -> f8
  • ncfdtrinc:
    • (f4, f4, f4, f4, /) -> f4
    • (f8, f8, f8, f8, /) -> f8
  • sph_harm:
    • (i8, i8, f8, f8, /) -> c16
    • (f8, f8, f8, f8, /) -> c16
    • (i8, i8, f4, f4, /) -> c8
    • (f4, f4, f4, f4, /) -> c8
  • fresnel:
    • (f4, /) -> (f4, f4)
    • (f8, /) -> (f8, f8)
    • (c8, /) -> (c8, c8)
    • (c16, /) -> (c16, c16)
  • it2i0k0:
    • (f4, /) -> (f4, f4)
    • (f8, /) -> (f8, f8)
  • it2j0y0:
    • (f4, /) -> (f4, f4)
    • (f8, /) -> (f8, f8)
  • iti0k0:
    • (f4, /) -> (f4, f4)
    • (f8, /) -> (f8, f8)
  • itj0y0:
    • (f4, /) -> (f4, f4)
    • (f8, /) -> (f8, f8)
  • modfresnelm:
    • (f4, /) -> (c8, c8)
    • (f8, /) -> (c16, c16)
  • modfresnelp:
    • (f4, /) -> (c8, c8)
    • (f8, /) -> (c16, c16)
  • shichi:
    • (f4, /) -> (f4, f4)
    • (f8, /) -> (f8, f8)
    • (c8, /) -> (c8, c8)
    • (c16, /) -> (c16, c16)
  • sici:
    • (f4, /) -> (f4, f4)
    • (f8, /) -> (f8, f8)
    • (c8, /) -> (c8, c8)
    • (c16, /) -> (c16, c16)
  • pbdv:
    • (f4, f4, /) -> (f4, f4)
    • (f8, f8, /) -> (f8, f8)
  • pbvv:
    • (f4, f4, /) -> (f4, f4)
    • (f8, f8, /) -> (f8, f8)
  • pbwa:
    • (f4, f4, /) -> (f4, f4)
    • (f8, f8, /) -> (f8, f8)
  • mathieu_cem:
    • (f4, f4, f4, /) -> (f4, f4)
    • (f8, f8, f8, /) -> (f8, f8)
  • mathieu_modcem1:
    • (f4, f4, f4, /) -> (f4, f4)
    • (f8, f8, f8, /) -> (f8, f8)
  • mathieu_modcem2:
    • (f4, f4, f4, /) -> (f4, f4)
    • (f8, f8, f8, /) -> (f8, f8)
  • mathieu_modsem1:
    • (f4, f4, f4, /) -> (f4, f4)
    • (f8, f8, f8, /) -> (f8, f8)
  • mathieu_modsem2:
    • (f4, f4, f4, /) -> (f4, f4)
    • (f8, f8, f8, /) -> (f8, f8)
  • mathieu_sem:
    • (f4, f4, f4, /) -> (f4, f4)
    • (f8, f8, f8, /) -> (f8, f8)
  • obl_ang1:
    • (f4, f4, f4, f4, /) -> (f4, f4)
    • (f8, f8, f8, f8, /) -> (f8, f8)
  • obl_rad1:
    • (f4, f4, f4, f4, /) -> (f4, f4)
    • (f8, f8, f8, f8, /) -> (f8, f8)
  • obl_rad2:
    • (f4, f4, f4, f4, /) -> (f4, f4)
    • (f8, f8, f8, f8, /) -> (f8, f8)
  • pro_ang1:
    • (f4, f4, f4, f4, /) -> (f4, f4)
    • (f8, f8, f8, f8, /) -> (f8, f8)
  • pro_rad1:
    • (f4, f4, f4, f4, /) -> (f4, f4)
    • (f8, f8, f8, f8, /) -> (f8, f8)
  • pro_rad2:
    • (f4, f4, f4, f4, /) -> (f4, f4)
    • (f8, f8, f8, f8, /) -> (f8, f8)
  • obl_ang1_cv:
    • (f4, f4, f4, f4, f4, /) -> (f4, f4)
    • (f8, f8, f8, f8, f8, /) -> (f8, f8)
  • obl_rad1_cv:
    • (f4, f4, f4, f4, f4, /) -> (f4, f4)
    • (f8, f8, f8, f8, f8, /) -> (f8, f8)
  • obl_rad2_cv:
    • (f4, f4, f4, f4, f4, /) -> (f4, f4)
    • (f8, f8, f8, f8, f8, /) -> (f8, f8)
  • pro_ang1_cv:
    • (f4, f4, f4, f4, f4, /) -> (f4, f4)
    • (f8, f8, f8, f8, f8, /) -> (f8, f8)
  • pro_rad1_cv:
    • (f4, f4, f4, f4, f4, /) -> (f4, f4)
    • (f8, f8, f8, f8, f8, /) -> (f8, f8)
  • pro_rad2_cv:
    • (f4, f4, f4, f4, f4, /) -> (f4, f4)
    • (f8, f8, f8, f8, f8, /) -> (f8, f8)
  • airy:
    • (f4, /) -> (f4, f4, f4, f4)
    • (f8, /) -> (f8, f8, f8, f8)
    • (c8, /) -> (c8, c8, c8, c8)
    • (c16, /) -> (c16, c16, c16, c16)
  • airye:
    • (f4, /) -> (f4, f4, f4, f4)
    • (f8, /) -> (f8, f8, f8, f8)
    • (c8, /) -> (c8, c8, c8, c8)
    • (c16, /) -> (c16, c16, c16, c16)
  • itairy:
    • (f4, /) -> (f4, f4, f4, f4)
    • (f8, /) -> (f8, f8, f8, f8)
  • kelvin:
    • (f4, /) -> (c8, c8, c8, c8)
    • (f8, /) -> (c16, c16, c16, c16)
  • ellipj:
    • (f4, f4, /) -> (f4, f4, f4, f4)
    • (f8, f8, /) -> (f8, f8, f8, f8)

@jorenham
Copy link
Owner Author

jorenham commented Nov 21, 2024

ufunc counts per signature

46	['f->f', 'd->d']
40	['fff->f', 'ddd->d']
36	['ff->f', 'dd->d']
17	['f->f', 'd->d', 'F->F', 'D->D']
10	['fF->F', 'dD->D', 'ff->f', 'dd->d']
9	['dd->d', 'fF->F', 'ld->d', 'ff->f', 'dD->D']
6	['ff->f', 'ld->d', 'dd->d']
6	['ddd->dd', 'fff->ff']
6	['ffff->ff', 'dddd->dd']
6	['fffff->ff', 'ddddd->dd']
5	['dddd->d', 'ffff->f']
4	['fF->F', 'dD->D']
4	['f->ff', 'd->dd']
3	['dld->d', 'fff->f', 'ddd->d']
3	['ff->f', 'DD->D', 'dd->d', 'FF->F']
3	['fff->f', 'FFF->F', 'DDD->D', 'ddd->d']
3	['f->f', 'd->d', 'g->g']
3	['f->ff', 'F->FF', 'D->DD', 'd->dd']
3	['lld->d', 'fff->f', 'ddd->d']
3	['dd->dd', 'ff->ff']
2	['f->ffff', 'd->dddd', 'F->FFFF', 'D->DDDD']
2	['ffF->F', 'ldd->d', 'fff->f', 'ddD->D', 'ddd->d']
2	['ld->d']
2	['dddD->D', 'dddd->d', 'fffF->F', 'lddd->d', 'ffff->f']
2	['f->FF', 'd->DD']
1	['dd->dddd', 'ff->ffff']
1	['dddd->d', 'FFFF->F', 'DDDD->D', 'ffff->f']
1	['ddd->d', 'fff->f', 'ddD->D', 'ffF->F']
1	['dddd->d', 'ffff->f', 'dddD->D', 'fffF->F']
1	['f->ffff', 'd->dddd']
1	['d->DDDD', 'f->FFFF']
1	['ffff->F', 'llff->F', 'dddd->D', 'lldd->D']
1	['F->F', 'D->D']

@jorenham jorenham changed the title annotating the ufuncs in scipy.special 🌝 annotating the remaining 20% of untyped ufuncs in scipy.special Dec 6, 2024
@jorenham jorenham changed the title 🌝 annotating the remaining 20% of untyped ufuncs in scipy.special 🌝 improved scipy.special ufunc annotations Dec 6, 2024
@jorenham jorenham changed the title 🌝 improved scipy.special ufunc annotations 🌝 improved scipy.special ufunc annotations (80% done) Dec 8, 2024
@jorenham jorenham removed their assignment Dec 10, 2024
@jorenham jorenham changed the title 🌝 improved scipy.special ufunc annotations (80% done) 🌝 improved special ufunc annotations (80% done) Dec 17, 2024
@jorenham jorenham self-assigned this Dec 24, 2024
@jorenham jorenham changed the title 🌝 improved special ufunc annotations (80% done) 🌝 improved special ufunc annotations Dec 24, 2024
@jorenham jorenham changed the title 🌝 improved special ufunc annotations special ufunc type signature Dec 24, 2024
@jorenham
Copy link
Owner Author

damn, that sucked...

let's just hope it won't require a lot of maintenance of bug-fixing 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scipy.special stubs: improvement Improve or refactor existing annotations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant