| 318 | |
| 319 | @pytest.mark.parametrize("T, m", test_data) |
| 320 | def test_mstump_wrapper_include(T, m): |
| 321 | for width in range(T.shape[0]): |
| 322 | for i in range(T.shape[0] - width): |
| 323 | include = np.asarray(range(i, i + width + 1)) |
| 324 | |
| 325 | excl_zone = int(np.ceil(m / 4)) |
| 326 | |
| 327 | ref_P, ref_I = naive.mstump(T, m, excl_zone, include) |
| 328 | comp_P, comp_I = mstump(T, m, include) |
| 329 | |
| 330 | npt.assert_almost_equal(ref_P, comp_P) |
| 331 | npt.assert_almost_equal(ref_I, comp_I) |
| 332 | |
| 333 | df = pd.DataFrame(T.T) |
| 334 | comp_P, comp_I = mstump(df, m, include) |
| 335 | |
| 336 | npt.assert_almost_equal(ref_P, comp_P) |
| 337 | npt.assert_almost_equal(ref_I, comp_I) |
| 338 | |
| 339 | |
| 340 | def test_constant_subsequence_self_join(): |