Skip to content

Commit 8c23783

Browse files
committed
🤡 linalg.det: shuffle disjoint overloads to avoid triggering a pyright bug
1 parent 22360ce commit 8c23783

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

‎scipy-stubs/linalg/_basic.pyi

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,32 +1036,30 @@ def inv(
10361036
a: onp.CanArrayND[np.complex128 | np.clongdouble, _ShapeT], overwrite_a: bool = False, check_finite: bool = True
10371037
) -> onp.ArrayND[np.complex128, _ShapeT]: ...
10381038

1039-
# TODO(jorenham): improve this
1039+
#
10401040
@overload # +float64 2d
10411041
def det(a: onp.ToFloat64Strict2D, overwrite_a: bool = False, check_finite: bool = True) -> np.float64: ...
1042-
@overload # +float64 3d
1043-
def det(a: onp.ToFloat64Strict3D, overwrite_a: bool = False, check_finite: bool = True) -> onp.Array1D[np.float64]: ...
1044-
@overload # +float64 ND
1045-
def det(a: onp.ToFloat64_ND, overwrite_a: bool = False, check_finite: bool = True) -> np.float64 | onp.ArrayND[np.float64]: ...
10461042
@overload # complex128 | complex64 2d
10471043
def det(
1048-
a: onp.ToJustComplex128Strict2D | onp.CanArray2D[np.complex64], overwrite_a: bool = False, check_finite: bool = True
1044+
a: onp.ToArrayStrict2D[op.JustComplex, np.complex128 | np.complex64], overwrite_a: bool = False, check_finite: bool = True
10491045
) -> np.complex128: ...
1046+
@overload # +float64 3d
1047+
def det(a: onp.ToFloat64Strict3D, overwrite_a: bool = False, check_finite: bool = True) -> onp.Array1D[np.float64]: ...
10501048
@overload # complex128 | complex64 3d
10511049
def det(
1052-
a: onp.ToJustComplex128Strict3D | onp.CanArray3D[np.complex64], overwrite_a: bool = False, check_finite: bool = True
1050+
a: onp.ToArrayStrict3D[op.JustComplex, np.complex128 | np.complex64], overwrite_a: bool = False, check_finite: bool = True
10531051
) -> onp.Array1D[np.complex128]: ...
1052+
@overload # +float64 ND
1053+
def det(a: onp.ToFloat64_ND, overwrite_a: bool = False, check_finite: bool = True) -> np.float64 | onp.ArrayND[np.float64]: ...
10541054
@overload # complex128 | complex64 Nd
10551055
def det(
1056-
a: onp.ToJustComplex128_ND, overwrite_a: bool = False, check_finite: bool = True
1056+
a: onp.ToArrayND[op.JustComplex, np.complex128 | np.complex64], overwrite_a: bool = False, check_finite: bool = True
10571057
) -> np.complex128 | onp.ArrayND[np.complex128]: ...
10581058
@overload # +complex128 2d
1059-
def det(
1060-
a: onp.ToComplex128Strict2D | onp.CanArray2D[np.complex64], overwrite_a: bool = False, check_finite: bool = True
1061-
) -> np.float64 | np.complex128: ...
1059+
def det(a: onp.ToComplex128Strict2D, overwrite_a: bool = False, check_finite: bool = True) -> np.float64 | np.complex128: ...
10621060
@overload # +complex128 3d
10631061
def det(
1064-
a: onp.ToComplex128Strict3D | onp.CanArray3D[np.complex64], overwrite_a: bool = False, check_finite: bool = True
1062+
a: onp.ToComplex128Strict3D, overwrite_a: bool = False, check_finite: bool = True
10651063
) -> onp.Array1D[np.float64 | np.complex128]: ...
10661064
@overload # +complex128 Nd
10671065
def det(

0 commit comments

Comments
 (0)