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

Function test_multi_mass_seeded

tests/test_mstump.py:39–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37
38
39def test_multi_mass_seeded():
40 np.random.seed(5)
41 T = np.random.uniform(-1000, 1000, [3, 10]).astype(np.float64)
42 m = 5
43
44 trivial_idx = 2
45
46 Q = T[:, trivial_idx : trivial_idx + m]
47
48 ref = naive.multi_mass(Q, T, m)
49
50 T_subseq_isconstant = core.rolling_isconstant(T, m)
51 M_T, Σ_T = core.compute_mean_std(T, m)
52
53 Q_subseq_isconstant = np.expand_dims(T_subseq_isconstant[:, trivial_idx], 1)
54
55 comp = _multi_mass(
56 Q,
57 T,
58 m,
59 M_T,
60 Σ_T,
61 M_T[:, trivial_idx],
62 Σ_T[:, trivial_idx],
63 T_subseq_isconstant=T_subseq_isconstant,
64 Q_subseq_isconstant=Q_subseq_isconstant,
65 query_idx=trivial_idx,
66 )
67
68 npt.assert_almost_equal(ref, comp, decimal=config.STUMPY_TEST_PRECISION)
69
70
71@pytest.mark.parametrize("T, m", test_data)

Callers

nothing calls this directly

Calls 1

_multi_massFunction · 0.90

Tested by

no test coverage detected