MCPcopy
hub / github.com/stumpy-dev/stumpy / test_scrump_self_join_full

Function test_scrump_self_join_full

tests/test_scrump.py:314–348  ·  view source on GitHub ↗
(T_A, T_B)

Source from the content-addressed store, hash-verified

312
313@pytest.mark.parametrize("T_A, T_B", test_data)
314def test_scrump_self_join_full(T_A, T_B):
315 m = 3
316 zone = int(np.ceil(m / 4))
317
318 ref_mp = naive.stump(T_B, m, exclusion_zone=zone, row_wise=True)
319 ref_P = ref_mp[:, 0]
320 ref_I = ref_mp[:, 1]
321 ref_left_I = ref_mp[:, 2]
322 ref_right_I = ref_mp[:, 3]
323
324 approx = scrump(T_B, m, ignore_trivial=True, percentage=1.0, pre_scrump=False)
325 approx.update()
326 comp_P = approx.P_
327 comp_I = approx.I_
328 comp_left_I = approx.left_I_
329 comp_right_I = approx.right_I_
330
331 naive.replace_inf(ref_P)
332 naive.replace_inf(comp_P)
333
334 npt.assert_almost_equal(ref_P, comp_P)
335 npt.assert_almost_equal(ref_I, comp_I)
336 npt.assert_almost_equal(ref_left_I, comp_left_I)
337 npt.assert_almost_equal(ref_right_I, comp_right_I)
338
339 ref_mp = stump(T_B, m, ignore_trivial=True)
340 ref_P = ref_mp[:, 0]
341 ref_I = ref_mp[:, 1]
342 ref_left_I = ref_mp[:, 2]
343 ref_right_I = ref_mp[:, 3]
344
345 npt.assert_almost_equal(ref_P, comp_P)
346 npt.assert_almost_equal(ref_I, comp_I)
347 npt.assert_almost_equal(ref_left_I, comp_left_I)
348 npt.assert_almost_equal(ref_right_I, comp_right_I)
349
350
351@pytest.mark.parametrize("T_A, T_B", test_data)

Callers

nothing calls this directly

Calls 3

scrumpClass · 0.90
stumpFunction · 0.90
updateMethod · 0.45

Tested by

no test coverage detected