diff --git a/stumpy/__init__.py b/stumpy/__init__.py index 4b65d9e6f..6ce63705e 100644 --- a/stumpy/__init__.py +++ b/stumpy/__init__.py @@ -21,6 +21,8 @@ from .aampdist import aampdist, aampdisted # noqa: F401 from .motifs import motifs, match # noqa: F401 from .aamp_motifs import aamp_motifs, aamp_match # noqa: F401 +from .mmotifs import mmotifs # noqa: F401 +from .aamp_mmotifs import aamp_mmotifs # noqa: F401 from .snippets import snippets # noqa: F401 from .aampdist_snippets import aampdist_snippets # noqa: F401 from .stimp import stimp, stimped # noqa: F401 diff --git a/tests/test_aamp_mmotifs.py b/tests/test_aamp_mmotifs.py index 49100a836..557e2d703 100755 --- a/tests/test_aamp_mmotifs.py +++ b/tests/test_aamp_mmotifs.py @@ -3,8 +3,7 @@ import naive import pytest -from stumpy.aamp_mmotifs import aamp_mmotifs -from stumpy import config +from stumpy import config, aamp_mmotifs test_data = [ diff --git a/tests/test_mmotifs.py b/tests/test_mmotifs.py index 75c8e19ce..5b0be51a2 100755 --- a/tests/test_mmotifs.py +++ b/tests/test_mmotifs.py @@ -3,8 +3,7 @@ import naive import pytest -from stumpy.mmotifs import mmotifs -from stumpy import config +from stumpy import config, mmotifs test_data = [ diff --git a/tests/test_non_normalized_decorator.py b/tests/test_non_normalized_decorator.py index e2471dcc3..2c6447d09 100644 --- a/tests/test_non_normalized_decorator.py +++ b/tests/test_non_normalized_decorator.py @@ -328,6 +328,18 @@ def test_match(T, m): npt.assert_almost_equal(ref, comp) +@pytest.mark.parametrize("T, m", test_data) +def test_mmotifs(T, m): + mps, indices = stumpy.maamp(T, m) + ref_distances, ref_indices, ref_subspaces, ref_mdls = stumpy.aamp_mmotifs( + T, mps, indices + ) + cmp_distances, cmp_indices, cmp_subspaces, cmp_mdls = stumpy.mmotifs( + T, mps, indices, normalize=False + ) + npt.assert_almost_equal(ref_distances, cmp_distances) + + def test_snippets(): T = np.random.rand(64) m = 10