Skip to main content

tsmotifs

tsmotifs is an open-source Python framework for time-series motif discovery. It accompanies a systematic review and benchmark project and provides a shared implementation surface for comparing motif discovery methods without replacing their original scientific definitions.

The project is intended for researchers and practitioners who need consistent algorithm interfaces, reproducible experiment execution, and common evaluation utilities across a broad and otherwise fragmented literature.

Main features

  • A common MotifFinder interface and shared motif result representation.
  • Integrations and reconstructions spanning several families of motif discovery methods.
  • Versioned configuration, manifest generation, and runners for reproducible experiments.
  • Common result serialization, aggregation, and interval-based evaluation support.

Installation

Install the core library from PyPI:

pip install tsmotifs

Some methods need additional dependencies. Install the relevant extra when required:

pip install "tsmotifs[integrations]"
pip install "tsmotifs[visualization]"
pip install "tsmotifs[deep]"

The benchmark runners and their configurations are distributed in the source repository. For benchmark reproduction or development, clone the repository and install it in editable mode:

git clone https://github.com/ChrisLe7/tsmotifs.git
cd tsmotifs
python -m pip install -e ".[benchmark]"

Use python -m pip install -e ".[dev]" to include the test and release-development tools.

Quick start

The following example uses the registered MK implementation on a small series containing a repeated subsequence:

import numpy as np

from tsmotifs import MK

series = np.array(
    [0, 1, 0, -1, 0, 1, 0, -1, 2, 2, 0, 1, 0, -1],
    dtype=float,
)

finder = MK(window_size=4)
motifs = finder.fit_discover(series, top_k=1)

for motif in motifs:
    print(motif.start, motif.length, motif.matches, motif.distance)

The common interface also exposes fit() and discover() separately. Use tsmotifs.list_algorithms() to inspect the algorithms bootstrapped into the public registry.

Supported methods

The repository covers exact, approximate, symbolic, grammar-based, probabilistic, online, optimization/learning, segmentation, and deep-learning approaches. Coverage reflects the scope of the accompanying review; individual integrations can have method-specific dependencies, input constraints, or external runtime requirements.

The top-level registry is deliberately conservative so that import tsmotifs remains safe when optional dependencies are absent. The benchmark configuration under experiment/config/ is the source of truth for methods used in each experimental phase.

Reproducibility

The experiment/ tree contains the versioned configurations, manifest builders, execution runners, aggregation code, and Slurm support used by the review benchmark. See the experimental pipeline and the HPC runbook before reproducing experiments.

Benchmark datasets and generated results are intentionally not part of the PyPI wheel. A link to the companion project website and the paper's final bibliographic record will be added when they are public; until then, this repository is the canonical supporting software artifact.

Citation

If you use tsmotifs, cite the associated review paper once its bibliographic record is available and cite the software version used in your experiments. Machine-readable software citation metadata is provided in CITATION.cff.

Contributing

Bug reports, documentation improvements, packaging fixes, and carefully scoped algorithm integrations are welcome. Please read CONTRIBUTING.md before opening an issue or pull request. Changes that affect taxonomy, evaluation methodology, or benchmark protocols require explicit scientific review.

License

tsmotifs is distributed under the BSD 3-Clause License.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tsmotifs-0.1.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tsmotifs-0.1.0-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

Details for the file tsmotifs-0.1.0.tar.gz.

File metadata

  • Download URL: tsmotifs-0.1.0.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for tsmotifs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 740f19ed774672e4b91e54e816fa79b697860f2b83e62977e76d2a3bcbc27195
MD5 b997640625a0625245de4f5055347fe9
BLAKE2b-256 65677d70c78ca09218f0aa83ba4cca67e3b244f2775d24cbe5abc2b2b95fdfa7

See more details on using hashes here.

File details

Details for the file tsmotifs-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tsmotifs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for tsmotifs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed47bc8b3f5b04159b4323808329273cc8943fc9b17396737166bc0d0ba22dc2
MD5 e187c920d5b26aec91d181536e09afea
BLAKE2b-256 ce4a20f6fbda7e3d5bd7c2f699332cf54d5213d8be4879497d93401fed7d7aac

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page