STUMPY computes one matrix profile and then changes the backend, not the algorithm
STUMPY is a powerful and scalable Python library for modern time series analysis
At a glance
- What is it?
- STUMPY is a Python library whose entire surface is the matrix profile, a nearest-neighbour lookup for every subsequence in a time series, with motif, discord, shapelet and segmentation work hanging off it. What is worth reading before you install it: the package still classifies itself as Alpha at version 1.14.1, numba is a hard runtime dependency rather than an extra, and the same function name changes shape depending on whether you want CPU, Dask or GPU.
- Who is it for?
- STUMPY is a good fit if your problem is subsequence matching in time series and you want one implementation that covers one-dimensional and multi-dimensional data across CPU, Dask and GPU, since the API shape stays constant while the backend changes. Two things to weigh first.
- Can I use it commercially?
- Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
- Is it still maintained?
- Yes. The repository last received commits 3 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.
Star history
- stumpy-dev/stumpy4,174 ★ · +19
| Repository | 2026-09-23 | 2026-11-22 |
|---|---|---|
| stumpy-dev/stumpy | 4.2k | 4.2k |
19 Stars in the last 60 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
Five function families for one computation
The library is organised around a single idea. The matrix profile is described as identifying, for every subsequence within a time series, its corresponding nearest neighbour, and once you have that array, the rest of the library is downstream work. What changes between functions is not the mathematics but where it runs and how many dimensions it takes.
The plain path is `stumpy.stump`, which takes the series and a window size:
import stumpy
import numpy as np
if __name__ == "__main__":
your_time_series = np.random.rand(10000)
window_size = 50 # Approximately, how many data points might be found in a pattern
matrix_profile = stumpy.stump(your_time_series, m=window_size)The window size argument is `m`, and the comment in the example is the clearest statement of its meaning: roughly how many data points might be found in a pattern. Variants then append a letter to the name. `stumpy.stumped` is the same call through Dask Distributed, `stumpy.mstump` handles multi-dimensional input and returns indices as well as values, `stumpy.mstumped` is the Dask version of that, and `stumpy.gpu_stump` moves the work onto CUDA devices.
gpu_stump takes a list of device ids, not a device index
The GPU path has a different shape at the call site, and it is the one detail worth copying carefully. Instead of a scalar, it takes a list of device ids collected from the numba CUDA interface:
import stumpy
import numpy as np
from numba import cuda
if __name__ == "__main__":
your_time_series = np.random.rand(10000)
window_size = 50 # Approximately, how many data points might be found in a pattern
all_gpu_devices = [device.id for device in cuda.list_devices()] # Get a list of all available GPU devices
matrix_profile = stumpy.gpu_stump(your_time_series, m=window_size, device_id=all_gpu_devices)So the caller is expected to enumerate the hardware first and hand the whole set over as `device_id`. That is a different contract from the CPU call, which takes only the series and `m`, and it means the function signature is not interchangeable across backends even though the computation is. The import list changes too: `numba.cuda` has to be importable before the call, so the GPU route is not something you can switch on by passing an argument to the same function.
MSTUMP returns indices too, because multi-dimensional rows need them
Multi-dimensional input is handled by `mstump`, which takes an array whose rows are different dimensions and whose columns are aligned samples, and returns two values rather than one:
matrix_profile, matrix_profile_indices = stumpy.mstump(your_time_series, m=window_size)The indices matter because in the multi-dimensional case a neighbour is a location in a row as well as a distance, so the caller needs the position to slice the original data. The single-dimensional `stump` call returns the profile alone in the example shown, which is the simpler contract and the reason the two calls do not return the same shape.
The distributed versions follow the same split. `stumped` wraps the one-dimensional call in a Dask client context, and `mstumped` does the same for the multi-dimensional one:
from dask.distributed import Client
with Client() as dask_client:
matrix_profile, matrix_profile_indices = stumpy.mstumped(dask_client, your_time_series, m=window_size)The client object is passed as the first argument, so the distributed variants are separate entry points rather than a flag.
Classified as Alpha at version 1.14.1, with a Python 3.11 floor
The packaging metadata is where the surprises sit. The version is 1.14.1, matching the newest tag, and the release history shows a long gap before it: v1.13.0 dated 2024-07-09, then v1.14.0 on 2026-02-03 and v1.14.1 on 2026-02-08. Against that, the classifiers still include `Development Status :: 3 - Alpha`, which is what package indexes surface first, so a project with a year-plus of stable tags presents itself as alpha software.
The floor is `requires-python >= 3.11`, and the classifiers enumerate 3.11 through 3.15 with Windows, POSIX, Unix and MacOS listed as supported systems. Runtime dependencies are three and only three: numpy from 1.24, scipy from 1.10 and numba from 0.61.2, with `requirements.txt` repeating the same three lines. numba being mandatory rather than an extra is the decision that most affects an install, since it brings a compiler toolchain into the picture for a library that also advertises GPU support.
The licence has a split record. `pyproject.toml` declares BSD-3-Clause and names `LICENSE.txt` as the licence file, and the README's licence badge points at that same file, while the repository's own licence field carries no value at all.
The ci extra installs the test stack, including tbb on Linux only
Everything needed to run the suite sits in one optional dependency group called `ci`, and it is long: pandas, dask, distributed, coverage, flake8 with its docstrings plugin, black, pytest, isort, polars and lxml. The interesting entry is `tbb`, pinned at 2019.5 and marked to install only when `platform_system == "Linux"`, which is the threading runtime for the parallel paths. A developer on macOS or Windows therefore gets a different dependency set than one on Linux, and that difference is expressed as a marker rather than as separate extras.
The root of the repository carries the matching shell scripts: `conda.sh`, `pip.sh`, `numba.sh`, `setup.sh` and `test.sh`, alongside `environment.yml` for the conda route and `requirements.txt` for the pip route. There is also `whitelist.txt`, `versions.py`, a top-level `docstring.py` and `fastmath.py`, which are repository tooling rather than library modules, plus `conftest.py`, `pytest.ini`, `.coveragerc`, `.flake8` and `codecov.yml` for the test and lint configuration.
Nine downstream tasks, and one of them picks the window size for you
The pitch for computing the profile at all is the list of things it unlocks. Pattern or motif discovery, which is approximately repeated subsequences inside a longer series, and anomaly or novelty discovery, called discord discovery, are the two headline uses. Then shapelet discovery, semantic segmentation, streaming or on-line data, fast approximate matrix profiles, time series chains as a temporally ordered set of subsequence patterns, and snippets for summarising a long series.
The ninth is the one that changes how you use the library. Pan matrix profiles exist for selecting the best subsequence window size, which means the tool can help answer the question you would otherwise guess at: how many data points should a pattern window contain. The list closes with a link to a time series data mining questions document rather than a claim of completeness, so the boundary is a link, not a list.
The projects around the library are also visible in the repository: a JOSS DOI badge, a NumFOCUS affiliated project badge, `CITATION.bib` for citing the software, and a `paper/` directory alongside `notebooks/` for the Binder examples.
The readme is reStructuredText, and it stops at a heading beginning with T
The readme file is `README.rst`, not Markdown, and it is built the old way: a block of substitution definitions where each badge is declared as a named RST directive pointing at a shields.io image, followed by the title and the introduction. `pyproject.toml` reads the same file as its long description, so the badges are part of the package description on PyPI.
Among the badges, coverage is a static one reading 100% rather than a live query, which sits alongside `codecov.yml` and `.coveragerc` in the tree. Binder is configured too, with a `postBuild` file and the `notebooks/` directory, so the examples run without a local install.
The text itself ends mid-structure. After the multi-dimensional Dask example, the file breaks off at a single capital T, which is where the next section heading would have begun, so whatever section the readme introduces next is not present in the file. The introductory sections that do exist define the matrix profile, list the downstream tasks and point at the hosted API documentation and tutorials for the rest.
Editorial conclusion
STUMPY is a good fit if your problem is subsequence matching in time series and you want one implementation that covers one-dimensional and multi-dimensional data across CPU, Dask and GPU, since the API shape stays constant while the backend changes. Two things to weigh first. The package metadata still carries the Alpha development status classifier at version 1.14.1, so treat the API as something that has moved before, and check the changelog against the version you pin. And numba is a runtime dependency rather than an optional extra, alongside numpy and scipy, so the install is heavier than a pure scientific stack. The licence deserves a look too: it is declared as BSD-3-Clause in `pyproject.toml` with `LICENSE.txt` named as the licence file, while the repository's own licence field records nothing.
Frequently asked questions
What is STUMPY?
STUMPY is a Python library for time series analysis built around the matrix profile, which identifies for every subsequence in a series its nearest neighbour. Version 1.14.1 requires Python 3.11 or newer and depends on numpy, scipy and numba, with optional Dask and CUDA paths. The package metadata still classifies it as Alpha.
What does the name stumpy mean in this project?
The repository never explains the name. What it defines is the library itself: a scalable Python implementation of the matrix profile, used for motif discovery, anomaly or discord discovery, shapelet discovery, semantic segmentation, streaming data, time series chains and pan matrix profiles for choosing a window size.
What is the matrix profile that STUMPY computes?
It is described as automatically identifying, for every subsequence within a time series, its corresponding nearest neighbour. Once computed, that array feeds the downstream tasks the library supports, from motif and discord discovery to segmentation and summarising a long series by snippets.
Does STUMPY run on a GPU?
Yes, through `stumpy.gpu_stump`, which requires numba's cuda interface. The documented pattern enumerates the hardware with `[device.id for device in cuda.list_devices()]` and passes the whole list as `device_id`, so the GPU call has a different signature from the CPU `stumpy.stump` call rather than being a flag on it.
How do I install STUMPY?
The visible readme text says installation is straightforward and defers to the hosted documentation rather than printing a command. The repository ships install scripts at its root, `conda.sh`, `pip.sh`, `numba.sh` and `setup.sh`, plus an `environment.yml` for the conda route and a `requirements.txt` naming numpy from 1.24, scipy from 1.10 and numba from 0.61.2. Python 3.11 or newer is required.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/stumpy-dev-stumpy)Star history chart for your README
[](https://hysenlabs.com/projects/stumpy-dev-stumpy)Was this useful?