Skip to content

Commit

Permalink
🐛 somehow the CI only now shows these np.float128 typo's
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenham committed Dec 24, 2024
1 parent d5cbfd6 commit 5b068f9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions scipy-stubs/sparse/linalg/_eigen/arpack/arpack.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ class ArpackError(RuntimeError):
def __init__(self, /, info: _KT, infodict: Mapping[_KT, str] = ...) -> None: ...

class ArpackNoConvergence(ArpackError):
eigenvalues: Final[onp.Array1D[np.float64 | np.float128]]
eigenvalues: Final[onp.Array1D[np.float64 | np.complex128]]
eigenvectors: Final[onp.Array2D[np.float64]]
def __init__(
self,
/,
msg: str,
eigenvalues: onp.Array1D[np.float64 | np.float128],
eigenvalues: onp.Array1D[np.float64 | np.complex128],
eigenvectors: onp.Array2D[np.float64],
) -> None: ...

Expand Down
2 changes: 1 addition & 1 deletion scipy-stubs/spatial/distance.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def mahalanobis(u: onp.ToComplex1D, v: onp.ToComplex1D, VI: onp.ToComplex1D) ->
@overload
def sokalsneath(u: onp.ToFloat1D, v: onp.ToFloat1D, w: onp.ToFloat1D | None = None) -> np.float64: ...
@overload
def sokalsneath(u: onp.ToComplex1D, v: onp.ToComplex1D, w: onp.ToFloat1D | None = None) -> np.float64 | np.float128: ...
def sokalsneath(u: onp.ToComplex1D, v: onp.ToComplex1D, w: onp.ToFloat1D | None = None) -> np.float64 | np.complex128: ...

#
@overload
Expand Down
8 changes: 2 additions & 6 deletions tests/special/test_ufuncs.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import scipy.special as sp

_Float32ND: TypeAlias = onp.ArrayND[np.float32]
_Float64ND: TypeAlias = onp.ArrayND[np.float64]
_LongDoubleND: TypeAlias = onp.ArrayND[np.longdouble]
_Complex64ND: TypeAlias = onp.ArrayND[np.complex64]
_Complex128ND: TypeAlias = onp.ArrayND[np.complex128]

Expand All @@ -17,7 +16,6 @@ _f: np.floating[Any]
_f2: np.float16
_f4: np.float32
_f8: np.float64
_g: np.longdouble
_c8: np.complex64
_c16: np.complex128

Expand All @@ -26,10 +24,11 @@ _i1_nd: onp.ArrayND[np.uint8 | np.int8]
_f2_nd: onp.ArrayND[np.float16]
_f4_nd: _Float32ND
_f8_nd: _Float64ND
_g_nd: _LongDoubleND
_c8_nd: _Complex64ND
_c16_nd: _Complex128ND

# NOTE: `[c]longdouble` can't be tested, because it types as `floating[Any]` on `numpy<2.2`

# _UFunc
assert_type(sp.cbrt.__name__, L["cbrt"])
assert_type(sp.cbrt.identity, L[0])
Expand Down Expand Up @@ -75,8 +74,6 @@ assert_type(sp.logit(_f4), np.float32)
assert_type(sp.logit(_f4_nd), _Float32ND)
assert_type(sp.logit(_f8), np.float64)
assert_type(sp.logit(_f8_nd), _Float64ND)
assert_type(sp.logit(_g), np.longdouble)
assert_type(sp.logit(_g_nd), _LongDoubleND)
sp.logit(_c16) # type:ignore[arg-type] # pyright: ignore[reportArgumentType, reportCallIssue]
sp.logit(_c16_nd) # type:ignore[arg-type] # pyright: ignore[reportArgumentType, reportCallIssue]
assert_type(sp.logit(0), np.float64)
Expand All @@ -85,7 +82,6 @@ assert_type(sp.logit(0.0), np.float64)
assert_type(sp.logit([0.0]), _Float64ND)
assert_type(sp.logit.at(_b1_nd, _i), None)
assert_type(sp.logit.at(_f8_nd, _i), None)
assert_type(sp.logit.at(_g_nd, _i), None)
sp.logit.at(_c16, _i) # type:ignore[arg-type] # pyright: ignore[reportArgumentType]

# _UFunc11c - TODO: wofz
Expand Down

0 comments on commit 5b068f9

Please sign in to comment.