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

Function test_scraamp_A_B_join

tests/test_scraamp.py:146–180  ·  view source on GitHub ↗
(T_A, T_B, percentages)

Source from the content-addressed store, hash-verified

144@pytest.mark.parametrize("T_A, T_B", test_data)
145@pytest.mark.parametrize("percentages", percentages)
146def test_scraamp_A_B_join(T_A, T_B, percentages):
147 m = 3
148
149 for p in [1.0, 2.0, 3.0]:
150 for percentage in percentages:
151 seed = np.random.randint(100000)
152
153 np.random.seed(seed)
154 ref_P, ref_I, ref_left_I, ref_right_I = naive.scraamp(
155 T_A, m, T_B, percentage, None, False, None, p=p
156 )
157
158 np.random.seed(seed)
159 approx = scraamp(
160 T_A,
161 m,
162 T_B,
163 ignore_trivial=False,
164 percentage=percentage,
165 pre_scraamp=False,
166 p=p,
167 )
168 approx.update()
169 comp_P = approx.P_
170 comp_I = approx.I_
171 comp_left_I = approx.left_I_
172 comp_right_I = approx.right_I_
173
174 naive.replace_inf(ref_P)
175 naive.replace_inf(comp_P)
176
177 npt.assert_almost_equal(ref_P, comp_P)
178 npt.assert_almost_equal(ref_I, comp_I)
179 npt.assert_almost_equal(ref_left_I, comp_left_I)
180 npt.assert_almost_equal(ref_right_I, comp_right_I)
181
182
183@pytest.mark.parametrize("T_A, T_B", test_data)

Callers

nothing calls this directly

Calls 2

scraampClass · 0.90
updateMethod · 0.45

Tested by

no test coverage detected