Skip to content

Commit 57352ae

Browse files
committed
signal.windows: Allow positional or keyword argument passing in
`dpss`. In `_windows.pyi` and the `dpss` function. Allow callers to use positional or keyword argument passing for `Kmax` and `return_ratios`.
1 parent b473e3f commit 57352ae

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

scipy-stubs/signal/windows/_windows.pyi

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def taylor(
138138
) -> _Array_f8_1d: ...
139139
def lanczos(M: _WindowLength, *, sym: op.CanBool = True) -> _Array_f8_1d: ...
140140

141-
#
141+
# Overloads where `return_ratios` is `False`.
142142
@overload
143143
def dpss(
144144
M: _WindowLength,
@@ -157,23 +157,52 @@ def dpss(
157157
norm: _Norm | None = None,
158158
return_ratios: Literal[False] = False,
159159
) -> _Array_f8_1d: ...
160+
161+
# Overloads where `return_ratios` is `True`.
162+
# `return_ratios` as a positional argument
160163
@overload
161164
def dpss(
162165
M: _WindowLength,
163166
NW: AnyReal,
164167
Kmax: op.CanIndex,
168+
sym: op.CanBool,
169+
norm: _Norm | None,
165170
return_ratios: Literal[True],
171+
) -> tuple[_Array_f8_2d, _Array_f8_1d]: ...
172+
173+
# `return_ratios` as a keyword argument
174+
@overload
175+
def dpss(
176+
M: _WindowLength,
177+
NW: AnyReal,
178+
Kmax: op.CanIndex,
166179
sym: op.CanBool = True,
167180
norm: _Norm | None = None,
181+
*,
182+
return_ratios: Literal[True],
168183
) -> tuple[_Array_f8_2d, _Array_f8_1d]: ...
184+
185+
# `return_ratios` as a positional argument
169186
@overload
170187
def dpss(
171188
M: _WindowLength,
172189
NW: AnyReal,
190+
Kmax: None,
191+
sym: op.CanBool,
192+
norm: _Norm | None,
173193
return_ratios: Literal[True],
194+
) -> tuple[_Array_f8_1d, np.float64]: ...
195+
196+
# `return_ratios` as a keyword argument
197+
@overload
198+
def dpss(
199+
M: _WindowLength,
200+
NW: AnyReal,
174201
Kmax: None = None,
175202
sym: op.CanBool = True,
176203
norm: _Norm | None = None,
204+
*,
205+
return_ratios: Literal[True],
177206
) -> tuple[_Array_f8_1d, np.float64]: ...
178207

179208
#

0 commit comments

Comments
 (0)