| 351 | |
| 352 | |
| 353 | def test_identical_subsequence_self_join(): |
| 354 | identical = np.random.rand(8) |
| 355 | T_A = np.random.rand(20) |
| 356 | T_A[1 : 1 + identical.shape[0]] = identical |
| 357 | T_A[11 : 11 + identical.shape[0]] = identical |
| 358 | T = np.array([T_A, T_A, np.random.rand(T_A.shape[0])]) |
| 359 | m = 3 |
| 360 | |
| 361 | excl_zone = int(np.ceil(m / 4)) |
| 362 | |
| 363 | ref_P, ref_I = naive.mstump(T, m, excl_zone) |
| 364 | comp_P, comp_I = mstump(T, m) |
| 365 | |
| 366 | npt.assert_almost_equal( |
| 367 | ref_P, comp_P, decimal=config.STUMPY_TEST_PRECISION |
| 368 | ) # ignore indices |
| 369 | |
| 370 | |
| 371 | @pytest.mark.parametrize("T, m", test_data) |