Skip to content

Commit d288451

Browse files
authored
Added mmotifs and aamp_motifs to top level API (#580)
1 parent 4251ac3 commit d288451

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

stumpy/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
from .aampdist import aampdist, aampdisted # noqa: F401
2222
from .motifs import motifs, match # noqa: F401
2323
from .aamp_motifs import aamp_motifs, aamp_match # noqa: F401
24+
from .mmotifs import mmotifs # noqa: F401
25+
from .aamp_mmotifs import aamp_mmotifs # noqa: F401
2426
from .snippets import snippets # noqa: F401
2527
from .aampdist_snippets import aampdist_snippets # noqa: F401
2628
from .stimp import stimp, stimped # noqa: F401

tests/test_aamp_mmotifs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
import naive
44
import pytest
55

6-
from stumpy.aamp_mmotifs import aamp_mmotifs
7-
from stumpy import config
6+
from stumpy import config, aamp_mmotifs
87

98

109
test_data = [

tests/test_mmotifs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
import naive
44
import pytest
55

6-
from stumpy.mmotifs import mmotifs
7-
from stumpy import config
6+
from stumpy import config, mmotifs
87

98

109
test_data = [

tests/test_non_normalized_decorator.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,18 @@ def test_match(T, m):
328328
npt.assert_almost_equal(ref, comp)
329329

330330

331+
@pytest.mark.parametrize("T, m", test_data)
332+
def test_mmotifs(T, m):
333+
mps, indices = stumpy.maamp(T, m)
334+
ref_distances, ref_indices, ref_subspaces, ref_mdls = stumpy.aamp_mmotifs(
335+
T, mps, indices
336+
)
337+
cmp_distances, cmp_indices, cmp_subspaces, cmp_mdls = stumpy.mmotifs(
338+
T, mps, indices, normalize=False
339+
)
340+
npt.assert_almost_equal(ref_distances, cmp_distances)
341+
342+
331343
def test_snippets():
332344
T = np.random.rand(64)
333345
m = 10

0 commit comments

Comments
 (0)