Skip to content

Commit 445a6cb

Browse files
committed
use smaller input to make test function more understandable
1 parent 9f71816 commit 445a6cb

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tests/test_core.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,14 @@ def test_check_max_window_size():
195195
def test_check_window_size_excl_zone():
196196
# To ensure warning is raised if there is at least one subsequence
197197
# that has no non-trivial neighbor
198-
T = np.random.rand(100)
199-
m = 70
200-
201-
# For `m==70`, the `excl_zone` is ceil(m / 4) = 18. For `len(T)==100`,
202-
# the subsequence that starts at index 15 has no non-trivial neighbor.
203-
# The expectation is that `core.check_window_size` raises warning.
198+
T = np.random.rand(10)
199+
m = 7
200+
201+
# For `len(T) == 10` and `m == 7`, the `excl_zone` is ceil(m / 4) = 2.
202+
# In this case, there are `10 - 7 + 1 = 4` subsequences of length 7,
203+
# starting at indices 0, 1, 2, and 3. For a subsequence that starts at
204+
# index 1, there are no non-trivial neighbors. So, a warning should be
205+
# raised.
204206
with pytest.warns(UserWarning):
205207
core.check_window_size(m, max_size=len(T), n=len(T))
206208

0 commit comments

Comments
 (0)