Skip to content

Commit 1eb878d

Browse files
committed
add new test function for identical subsequences with different scales
1 parent 5b79efb commit 1eb878d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/test_precision.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,3 +223,25 @@ def test_stump_identical_subsequence_self_join_rare_cases_1():
223223
npt.assert_almost_equal(
224224
ref_mp[:, 0], comp_mp[:, 0], decimal=config.STUMPY_TEST_PRECISION
225225
) # ignore indices
226+
227+
228+
def test_stump_identical_subsequence_self_join_rare_cases_2():
229+
m = 3
230+
zone = int(np.ceil(m / 4))
231+
232+
seed_values = [27343, 84451]
233+
for seed in seed_values:
234+
np.random.seed(seed)
235+
236+
identical = np.random.rand(8)
237+
T_A = np.random.rand(20)
238+
T_A[1 : 1 + identical.shape[0]] = identical * 0.001
239+
T_A[11 : 11 + identical.shape[0]] = identical * 1000
240+
241+
ref_mp = naive.stump(T_A, m, exclusion_zone=zone, row_wise=True)
242+
comp_mp = stumpy.stump(T_A, m, ignore_trivial=True)
243+
naive.replace_inf(ref_mp)
244+
naive.replace_inf(comp_mp)
245+
npt.assert_almost_equal(
246+
ref_mp[:, 0], comp_mp[:, 0], decimal=config.STUMPY_TEST_PRECISION
247+
) # ignore indices

0 commit comments

Comments
 (0)