@@ -5,7 +5,7 @@ import numpy as np
55import numpy .typing as npt
66import optype as op
77import optype .numpy as onp
8- from numpy ._typing import _ArrayLike , _DTypeLike , _NestedSequence
8+ from numpy ._typing import _ArrayLike , _DTypeLike
99from 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
3029def sawtooth (t : _ArrayLikeFloat , width : _ArrayLikeFloat = 1 ) -> _Array_f8 : ...
3130def 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
4534def 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#
5655def sweep_poly (
0 commit comments