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

Function test_aamp_stimp_100_percent

tests/test_aamp_stimp.py:149–197  ·  view source on GitHub ↗
(T)

Source from the content-addressed store, hash-verified

147
148@pytest.mark.parametrize("T", T)
149def test_aamp_stimp_100_percent(T):
150 threshold = 0.2
151 percentage = 1.0
152 min_m = 3
153 n = T.shape[0] - min_m + 1
154
155 pan = aamp_stimp(
156 T,
157 min_m=min_m,
158 max_m=None,
159 step=1,
160 percentage=percentage,
161 pre_scraamp=False,
162 )
163
164 for i in range(n):
165 pan.update()
166
167 ref_PAN = np.full((pan.M_.shape[0], T.shape[0]), fill_value=np.inf)
168
169 for idx, m in enumerate(pan.M_[:n]):
170 zone = int(np.ceil(m / 4))
171 ref_mp = naive.aamp(T, m, T_B=None, exclusion_zone=zone)
172 ref_PAN[pan._bfs_indices[idx], : ref_mp.shape[0]] = ref_mp[:, 0]
173
174 # Compare raw pan
175 cmp_PAN = pan._PAN
176
177 naive.replace_inf(ref_PAN)
178 naive.replace_inf(cmp_PAN)
179
180 npt.assert_almost_equal(ref_PAN, cmp_PAN)
181
182 # Compare transformed pan
183 cmp_pan = pan.PAN_
184 ref_pan = naive.transform_pan(
185 pan._PAN,
186 pan._M,
187 threshold,
188 pan._bfs_indices,
189 pan._n_processed,
190 np.min(T),
191 np.max(T),
192 )
193
194 naive.replace_inf(ref_pan)
195 naive.replace_inf(cmp_pan)
196
197 npt.assert_almost_equal(ref_pan, cmp_pan)
198
199
200@pytest.mark.parametrize("T", T)

Callers

nothing calls this directly

Calls 2

aamp_stimpClass · 0.90
updateMethod · 0.45

Tested by

no test coverage detected