-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Comments
The
Note that The number of 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 Which is (almost always) equivalent to np.long | np.float32 | np.float64 | np.longdouble | np.complex64 | np.complex128
These are the 233
|
ufunc counts per signature
|
ufunc
s in scipy.special
scipy.special
scipy.special
scipy.special
ufunc annotations
scipy.special
ufunc annotationsscipy.special
ufunc annotations (80% done)
scipy.special
ufunc annotations (80% done)special
ufunc annotations (80% done)
special
ufunc annotations (80% done)special
ufunc annotations
special
ufunc annotationsspecial
ufunc type signature
damn, that sucked... let's just hope it won't require a lot of maintenance of bug-fixing 😅 |
The majority of the
scipy.special
functions arenumpy.ufunc
(230 / 356 ~= 64.6%).But the
numpy.ufunc
isn't generic, making most of the type signatures inscipy.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 possiblenin
andnargs
combinations (at mostnin=2
andnout=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)
{'f->f', 'd->d'}
{'f->f', 'd->d', 'g->g'}
{'f->f', 'd->d', 'F->F', 'D->D'}
{'F->F', 'D->D'}
{'ld->d'}
{'ff->f', '(l|d)d->d'}
{'fF->F', 'dD->D'}
{'ff->f', 'dd->d', 'fF->F', 'dD->D'}
{'ff->f', 'dd->d', 'FF->F', 'DD->D'}
{'fff->f', '(l|d)(l|d)d->d'}
{'fff->f', '(l|d)dd->d', 'ffF->F', 'ddD->D'}
{'fff->f', 'ddd->d', 'FFF->F', 'DDD->D'}
{'ffff->f', 'dddd->d'}
{'(qq|ff)ff->F', '(qq)dd->D'}
(sph_harm
){'ffff->f', '(l|d)ddd->d', 'fffF->F', 'dddD->D'}
{'ffff->f', 'dddd->d', 'FFFF->F', 'DDDD->D'}
{'f->ff', 'd->dd'}
{'f->FF', 'd->DD'}
{'f->ff', 'd->dd', 'F->FF', 'D->DD'}
{'ff->ff', 'dd->dd'}
{'fff->ff'. 'ddd->dd'}
{'ffff->ff', 'dddd->dd'}
{'fffff->ff', 'ddddd->dd'}
{'f->ffff', 'd->dddd'}
{'f->FFFF', 'd->DDDD'}
{'f->ffff', 'd->dddd', 'F->FFFF', 'D->DDDD'}
{'ff->ffff', 'dd->dddd'}
The text was updated successfully, but these errors were encountered: