MCPcopy Index your code
hub / github.com/stumpy-dev/stumpy / test_scrump_A_B_join_swap

Function test_scrump_A_B_join_swap

tests/test_scrump.py:200–227  ·  view source on GitHub ↗
(T_A, T_B, percentages)

Source from the content-addressed store, hash-verified

198@pytest.mark.parametrize("T_A, T_B", test_data)
199@pytest.mark.parametrize("percentages", percentages)
200def test_scrump_A_B_join_swap(T_A, T_B, percentages):
201 m = 3
202
203 for percentage in percentages:
204 seed = np.random.randint(100000)
205
206 np.random.seed(seed)
207 ref_P, _, ref_left_I, ref_right_I = naive.scrump(
208 T_B, m, T_A, percentage, None, False, None
209 )
210
211 np.random.seed(seed)
212 approx = scrump(
213 T_B, m, T_A, ignore_trivial=False, percentage=percentage, pre_scrump=False
214 )
215 approx.update()
216 comp_P = approx.P_
217 # comp_I = approx.I_
218 comp_left_I = approx.left_I_
219 comp_right_I = approx.right_I_
220
221 naive.replace_inf(ref_P)
222 naive.replace_inf(comp_P)
223
224 npt.assert_almost_equal(ref_P, comp_P)
225 npt.assert_almost_equal(ref_P, comp_P)
226 npt.assert_almost_equal(ref_left_I, comp_left_I)
227 npt.assert_almost_equal(ref_right_I, comp_right_I)
228
229
230@pytest.mark.parametrize("T_A, T_B", test_data)

Callers

nothing calls this directly

Calls 2

scrumpClass · 0.90
updateMethod · 0.45

Tested by

no test coverage detected