Skip to content

Commit 60570a0

Browse files
committed
signal: Fix chirp overload overlap in _waveforms.pyi
1 parent 4d74dc8 commit 60570a0

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

scipy-stubs/signal/_waveforms.pyi

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import numpy as np
55
import numpy.typing as npt
66
import optype as op
77
import optype.numpy as onp
8-
from numpy._typing import _ArrayLike, _DTypeLike, _NestedSequence
8+
from numpy._typing import _ArrayLike, _DTypeLike
99
from scipy._typing import AnyShape
1010

1111
__all__ = ["chirp", "gausspulse", "sawtooth", "square", "sweep_poly", "unit_impulse"]
@@ -23,34 +23,33 @@ _NBT2 = TypeVar("_NBT2", bound=npt.NBitBase)
2323
_NBT3 = TypeVar("_NBT3", bound=npt.NBitBase)
2424
_NBT4 = TypeVar("_NBT4", bound=npt.NBitBase)
2525
_NBT5 = TypeVar("_NBT5", bound=npt.NBitBase)
26-
_ChirpTime: TypeAlias = _ArrayLike[np.floating[_NBT1] | np.integer[_NBT1]]
2726
_ChirpScalar: TypeAlias = float | np.floating[_NBT1] | np.integer[_NBT1]
2827
_ChirpMethod: TypeAlias = Literal["linear", "quadratic", "logarithmic", "hyperbolic"]
2928

3029
def sawtooth(t: _ArrayLikeFloat, width: _ArrayLikeFloat = 1) -> _Array_f8: ...
3130
def square(t: _ArrayLikeFloat, duty: _ArrayLikeFloat = 0.5) -> _Array_f8: ...
3231

3332
#
34-
@overload # Static type checking for float values
35-
def chirp(
36-
t: _ChirpTime[_NBT1],
37-
f0: _ChirpScalar[_NBT2],
38-
t1: _ChirpScalar[_NBT3],
39-
f1: _ChirpScalar[_NBT4],
40-
method: _ChirpMethod = "linear",
41-
phi: _ChirpScalar[_NBT5] = 0,
42-
vertex_zero: op.CanBool = True,
43-
) -> onp.ArrayND[np.floating[_NBT1 | _NBT2 | _NBT3 | _NBT4 | _NBT5]]: ...
4433
@overload # Other dtypes default to np.float64
4534
def chirp(
46-
t: onp.ToFloatND | _NestedSequence[float],
35+
t: onp.SequenceND[float],
4736
f0: onp.ToFloat,
4837
t1: onp.ToFloat,
4938
f1: onp.ToFloat,
5039
method: _ChirpMethod = "linear",
5140
phi: onp.ToFloat = 0,
5241
vertex_zero: op.CanBool = True,
5342
) -> _Array_f8: ...
43+
@overload # Static type checking for float values
44+
def chirp(
45+
t: _ArrayLike[np.floating[_NBT1] | np.integer[_NBT1]],
46+
f0: _ChirpScalar[_NBT2],
47+
t1: _ChirpScalar[_NBT3],
48+
f1: _ChirpScalar[_NBT4],
49+
method: _ChirpMethod = "linear",
50+
phi: _ChirpScalar[_NBT5] = 0,
51+
vertex_zero: op.CanBool = True,
52+
) -> onp.ArrayND[np.floating[_NBT1 | _NBT2 | _NBT3 | _NBT4 | _NBT5]]: ...
5453

5554
#
5655
def sweep_poly(

0 commit comments

Comments
 (0)