RustDTW
Python extension backed by a multi-threaded Rust implementation of Dynamic Time Warping (DTW).
Install / Use
/learn @FL33TW00D/RustDTWREADME
⚡️ Quick Install
To install rustDTW, simply:
pip install rust-dtw
❓ What is Dynamic Time Warping
In time series analysis, dynamic time warping (DTW) is one of the algorithms for measuring similarity between two temporal sequences, which may vary in speed 1. This has applications in speech recognition, time series classification and neuroscience.
Example Usage
rustDTW was designed for usage with timeseries data from functional brain regions. However any data represented as a numpy matrix can be provided.
import numpy as np
import rust_dtw
rust_dtw.dtw(
s=np.array([0., 1., 2.]),
t=np.array([3., 4., 5.]),
window=50,
distance_mode="euclidean"
)
>>> 5.0990195
For more examples please see examples/ or explore the wiki.
Developing
Built With
- PyO3
- Maturin
- rust-numpy
- Rayon
Setting up Dev
To get started with development, simply clone the repository and edit the main library code in src/. Once done, simply build and test the code with ./build.sh.
git clone https://github.com/FL33TW00D/rustDTW.git
cd rust-dtw/
./build.sh
Tests
All tests are implemented using pytest.
poetry run pytest
📈 Performance
<div align="center"> <img src="https://raw.githubusercontent.com/FL33TW00D/rustDTW/master/examples/speed/time.png" width=60%/><br/> </div> The above shows the performance of the rustdtw implementation vs the DTAIDistance OpenMP Python version, showing a ~10x speed improvement.⚠️ License
rustDTW is free and open-source software licensed under the MIT License.
Related Skills
himalaya
347.0kCLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
node-connect
347.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
taskflow
347.0kname: taskflow description: Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layer
frontend-design
107.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
