Skip to content

Commit

Permalink
tests: Add tests for the function dpss from singal.windows.
Browse files Browse the repository at this point in the history
This function has a few different overloads so it is nice to have tests
for them.
  • Loading branch information
pavyamsiri committed Nov 3, 2024
1 parent 57352ae commit 69cc2ea
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/signal/windows/test_windows.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from typing import TypeAlias
from typing_extensions import assert_type

import numpy as np
from scipy.signal.windows import dpss

_Array_f8_1d: TypeAlias = np.ndarray[tuple[int], np.dtype[np.float64]]
_Array_f8_2d: TypeAlias = np.ndarray[tuple[int, int], np.dtype[np.float64]]

# test dpss function overloads
assert_type(dpss(64, 3), _Array_f8_1d)
assert_type(dpss(64, 3, 2), _Array_f8_2d)
assert_type(dpss(64, 3, return_ratios=True), tuple[_Array_f8_1d, np.float64])
assert_type(dpss(64, 3, 2, return_ratios=True), tuple[_Array_f8_2d, _Array_f8_1d])

0 comments on commit 69cc2ea

Please sign in to comment.