Skip to content

Commit be37759

Browse files
committed
🎨 simplify some types using the new optype.numpy.CanArray0 type
1 parent 94e97a5 commit be37759

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

‎scipy-stubs/differentiate/_differentiate.pyi‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class _HessianResult(_RichResult, Generic[_FloatT_co, _ShapeT2_co]):
6868
@overload # 0-d float64
6969
def derivative(
7070
f: _Function00[np.float64],
71-
x: float | np.float64 | npc.integer | onp.CanArray0D[np.float64 | npc.integer],
71+
x: float | onp.CanArray0[np.float64 | npc.integer],
7272
*,
7373
args: tuple[onp.ToScalar, ...] = (),
7474
tolerances: _Tolerances | None = None,
@@ -83,7 +83,7 @@ def derivative(
8383
@overload # 0-d <known>
8484
def derivative(
8585
f: _Function00[_FloatT],
86-
x: _FloatT | onp.CanArray0D[_FloatT],
86+
x: onp.CanArray0[_FloatT],
8787
*,
8888
args: tuple[onp.ToScalar, ...] = (),
8989
tolerances: _Tolerances | None = None,

‎scipy-stubs/linalg/_special_matrices.pyi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ _Float3ND: TypeAlias = _Array3ND[np.float64]
4343
_Complex2D: TypeAlias = onp.Array2D[np.complex128]
4444
_Complex3ND: TypeAlias = _Array3ND[np.complex128]
4545

46-
_To0D: TypeAlias = _SCT | onp.CanArray0D[_SCT]
46+
_To0D: TypeAlias = onp.CanArray0[_SCT]
4747
_To1D: TypeAlias = Sequence[_To0D[_SCT]] | onp.CanArrayND[_SCT]
4848
_ToStrict1D: TypeAlias = Sequence[_To0D[_SCT]] | onp.CanArray1D[_SCT]
4949
_ToStrict2ND: TypeAlias = onp.SequenceND[_To1D[_SCT]] | onp.CanArrayND[_SCT, onp.AtLeast2D]

0 commit comments

Comments
 (0)