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

Function test_scraamp_self_join_full

tests/test_scraamp.py:250–284  ·  view source on GitHub ↗
(T_A, T_B)

Source from the content-addressed store, hash-verified

248
249@pytest.mark.parametrize("T_A, T_B", test_data)
250def test_scraamp_self_join_full(T_A, T_B):
251 m = 3
252 zone = int(np.ceil(m / 4))
253
254 ref_mp = naive.aamp(T_B, m, exclusion_zone=zone)
255 ref_P = ref_mp[:, 0]
256 ref_I = ref_mp[:, 1]
257 ref_left_I = ref_mp[:, 2]
258 ref_right_I = ref_mp[:, 3]
259
260 approx = scraamp(T_B, m, ignore_trivial=True, percentage=1.0, pre_scraamp=False)
261 approx.update()
262 comp_P = approx.P_
263 comp_I = approx.I_
264 comp_left_I = approx.left_I_
265 comp_right_I = approx.right_I_
266
267 naive.replace_inf(ref_P)
268 naive.replace_inf(comp_P)
269
270 npt.assert_almost_equal(ref_P, comp_P)
271 npt.assert_almost_equal(ref_I, comp_I)
272 npt.assert_almost_equal(ref_left_I, comp_left_I)
273 npt.assert_almost_equal(ref_right_I, comp_right_I)
274
275 ref_mp = aamp(T_B, m, ignore_trivial=True)
276 ref_P = ref_mp[:, 0]
277 ref_I = ref_mp[:, 1]
278 ref_left_I = ref_mp[:, 2]
279 ref_right_I = ref_mp[:, 3]
280
281 npt.assert_almost_equal(ref_P, comp_P)
282 npt.assert_almost_equal(ref_I, comp_I)
283 npt.assert_almost_equal(ref_left_I, comp_left_I)
284 npt.assert_almost_equal(ref_right_I, comp_right_I)
285
286
287@pytest.mark.parametrize("T_A, T_B", test_data)

Callers

nothing calls this directly

Calls 3

scraampClass · 0.90
aampFunction · 0.90
updateMethod · 0.45

Tested by

no test coverage detected