Skip to content

Commit 69cc2ea

Browse files
committed
tests: Add tests for the function dpss from singal.windows.
This function has a few different overloads so it is nice to have tests for them.
1 parent 57352ae commit 69cc2ea

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/signal/windows/test_windows.pyi

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from typing import TypeAlias
2+
from typing_extensions import assert_type
3+
4+
import numpy as np
5+
from scipy.signal.windows import dpss
6+
7+
_Array_f8_1d: TypeAlias = np.ndarray[tuple[int], np.dtype[np.float64]]
8+
_Array_f8_2d: TypeAlias = np.ndarray[tuple[int, int], np.dtype[np.float64]]
9+
10+
# test dpss function overloads
11+
assert_type(dpss(64, 3), _Array_f8_1d)
12+
assert_type(dpss(64, 3, 2), _Array_f8_2d)
13+
assert_type(dpss(64, 3, return_ratios=True), tuple[_Array_f8_1d, np.float64])
14+
assert_type(dpss(64, 3, 2, return_ratios=True), tuple[_Array_f8_2d, _Array_f8_1d])

0 commit comments

Comments
 (0)