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

Function test_aamp_stimped

tests/test_aamp_stimp.py:236–283  ·  view source on GitHub ↗
(T, dask_cluster)

Source from the content-addressed store, hash-verified

234@pytest.mark.filterwarnings("ignore:\\s+Port 8787 is already in use:UserWarning")
235@pytest.mark.parametrize("T", T)
236def test_aamp_stimped(T, dask_cluster):
237 with Client(dask_cluster) as dask_client:
238 threshold = 0.2
239 min_m = 3
240 n = T.shape[0] - min_m + 1
241
242 pan = aamp_stimped(
243 dask_client,
244 T,
245 min_m=min_m,
246 max_m=None,
247 step=1,
248 )
249
250 for i in range(n):
251 pan.update()
252
253 ref_PAN = np.full((pan.M_.shape[0], T.shape[0]), fill_value=np.inf)
254
255 for idx, m in enumerate(pan.M_[:n]):
256 zone = int(np.ceil(m / 4))
257 ref_mp = naive.aamp(T, m, T_B=None, exclusion_zone=zone)
258 ref_PAN[pan._bfs_indices[idx], : ref_mp.shape[0]] = ref_mp[:, 0]
259
260 # Compare raw pan
261 cmp_PAN = pan._PAN
262
263 naive.replace_inf(ref_PAN)
264 naive.replace_inf(cmp_PAN)
265
266 npt.assert_almost_equal(ref_PAN, cmp_PAN)
267
268 # Compare transformed pan
269 cmp_pan = pan.PAN_
270 ref_pan = naive.transform_pan(
271 pan._PAN,
272 pan._M,
273 threshold,
274 pan._bfs_indices,
275 pan._n_processed,
276 np.min(T),
277 np.max(T),
278 )
279
280 naive.replace_inf(ref_pan)
281 naive.replace_inf(cmp_pan)
282
283 npt.assert_almost_equal(ref_pan, cmp_pan)

Callers

nothing calls this directly

Calls 2

aamp_stimpedClass · 0.90
updateMethod · 0.45

Tested by

no test coverage detected