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

Function test_motifs_one_motif

tests/test_motifs.py:162–181  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

160
161
162def test_motifs_one_motif():
163 # The top motif for m=3 is a [0 1 0] at indices 0, 5 and 9
164 T = np.array([0.0, 1.0, 0.0, -1.0, -1.0, 0.0, 1.0, 0.0, -0.5, 2.0, 3.0, 2.0])
165 m = 3
166 max_motifs = 1
167
168 left_indices = [[0, 5, 9]]
169 left_profile_values = [[0.0, 0.0, 0.0]]
170
171 mp = naive.stump(T, m)
172 right_distance_values, right_indices = motifs(
173 T,
174 mp[:, 0],
175 max_distance=lambda D: 0.001, # Also test lambda functionality
176 max_motifs=max_motifs,
177 cutoff=np.inf,
178 )
179
180 npt.assert_array_equal(left_indices, right_indices)
181 npt.assert_almost_equal(left_profile_values, right_distance_values)
182
183
184def test_motifs_two_motifs():

Callers

nothing calls this directly

Calls 1

motifsFunction · 0.90

Tested by

no test coverage detected