Skip to main content

A rust implementation of dynamic time warping with python bindings!

Project description

RustDTW

Python extension backed by a multi-threaded Rust implementation of Dynamic Time Warping (DTW).


⚡️ 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


The above shows the performance of the rustdtw implementation vs the DTAIDistance OpenMP Python version (more benchmarks vs C implementation coming soon).

⚠️ License

rustDTW is free and open-source software licensed under the MIT License.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

rust_dtw-0.1.14-cp39-none-win_amd64.whl (374.7 kB view details)

Uploaded CPython 3.9 Windows x86-64

rust_dtw-0.1.14-cp39-cp39-manylinux_2_24_x86_64.whl (436.6 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.24+ x86-64

rust_dtw-0.1.14-cp39-cp39-macosx_10_7_x86_64.whl (401.6 kB view details)

Uploaded CPython 3.9 macOS 10.7+ x86-64

rust_dtw-0.1.14-cp38-none-win_amd64.whl (375.2 kB view details)

Uploaded CPython 3.8 Windows x86-64

rust_dtw-0.1.14-cp38-cp38-manylinux_2_24_x86_64.whl (436.9 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.24+ x86-64

rust_dtw-0.1.14-cp38-cp38-macosx_10_7_x86_64.whl (401.9 kB view details)

Uploaded CPython 3.8 macOS 10.7+ x86-64

rust_dtw-0.1.14-cp37-none-win_amd64.whl (375.5 kB view details)

Uploaded CPython 3.7 Windows x86-64

rust_dtw-0.1.14-cp37-cp37m-manylinux_2_24_x86_64.whl (436.9 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.24+ x86-64

rust_dtw-0.1.14-cp37-cp37m-macosx_10_7_x86_64.whl (402.1 kB view details)

Uploaded CPython 3.7m macOS 10.7+ x86-64

rust_dtw-0.1.14-cp36-none-win_amd64.whl (375.5 kB view details)

Uploaded CPython 3.6 Windows x86-64

rust_dtw-0.1.14-cp36-cp36m-manylinux_2_24_x86_64.whl (436.8 kB view details)

Uploaded CPython 3.6m manylinux: glibc 2.24+ x86-64

rust_dtw-0.1.14-cp36-cp36m-macosx_10_7_x86_64.whl (402.0 kB view details)

Uploaded CPython 3.6m macOS 10.7+ x86-64

File details

Details for the file rust_dtw-0.1.14-cp39-none-win_amd64.whl.

File metadata

File hashes

Hashes for rust_dtw-0.1.14-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 5d1d1d8432178f7a7026c290ff183b76f0293f28b866842e3013571a77a84e65
MD5 d076784f8fe2e6c25eb2b3c55f7b6ddb
BLAKE2b-256 053b7a7216c05c40390786e0a70deb9b5f91b01cc0321503dfc60bfc79d01ddf

See more details on using hashes here.

File details

Details for the file rust_dtw-0.1.14-cp39-cp39-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for rust_dtw-0.1.14-cp39-cp39-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 291ee3d0540906e151ddfecbb3f357f97183a941dfe0bbcc03d7654650d24bfe
MD5 1142ddbd3178ea99a67c19ec482198eb
BLAKE2b-256 d171fc4312f8c31af96dc0efa74b99fb40ac6972f70ec7f8248eda7a4a55824e

See more details on using hashes here.

File details

Details for the file rust_dtw-0.1.14-cp39-cp39-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for rust_dtw-0.1.14-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 a41dfae5cd0fb1e16ebf8911fbf2f1ffda55baf2a26220048ce51aeda06dafe1
MD5 87db0964976916d75e351ec3cdfad7e4
BLAKE2b-256 7145d6832d0510ebb3a3cd46d98ee0369cedb72dcb00bfaffcc5ceeef4293951

See more details on using hashes here.

File details

Details for the file rust_dtw-0.1.14-cp38-none-win_amd64.whl.

File metadata

File hashes

Hashes for rust_dtw-0.1.14-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 798375df16188760cdf5d2f08373606ac44f0c666c280d986626c2d839d55f65
MD5 5bd167aaa96a16ceeac85eda6c5322a8
BLAKE2b-256 444d4392d197383abfcb608ed7988d57989a63c1284f4525effcf2e8675a5d1a

See more details on using hashes here.

File details

Details for the file rust_dtw-0.1.14-cp38-cp38-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for rust_dtw-0.1.14-cp38-cp38-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 d618b1a389ef1a78a6d07916fd1ed758fadbf618fc294a8c5eb34db61d6741d7
MD5 64fe6321353823ea225c4dcc59cd8a31
BLAKE2b-256 20d6cdd9faafdddd6af77c09602e49702c3af7e1558fd3b419a00fd179002330

See more details on using hashes here.

File details

Details for the file rust_dtw-0.1.14-cp38-cp38-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for rust_dtw-0.1.14-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 e98e42c7e92b7600c4fb3d85c5eba27d6bbe2f52904a5de78a1c90ae44476a68
MD5 1fdbce0c243d2d8c93eb403b96383596
BLAKE2b-256 3bd2443cc70478b80d631ac48ad24868b141d69c557c8afd3e30307045378b1e

See more details on using hashes here.

File details

Details for the file rust_dtw-0.1.14-cp37-none-win_amd64.whl.

File metadata

File hashes

Hashes for rust_dtw-0.1.14-cp37-none-win_amd64.whl
Algorithm Hash digest
SHA256 8c62eb71f9b8bee0cb4b6420e60e534bf081faafcef4a70ce88a1792dbfd12d6
MD5 037466ed2bbdb53910cf25fdbc2f8e5e
BLAKE2b-256 ea01fa8471113f47912896c0bfaaeb49528cf0e4029e6d9a517d9e8afbb6943a

See more details on using hashes here.

File details

Details for the file rust_dtw-0.1.14-cp37-cp37m-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for rust_dtw-0.1.14-cp37-cp37m-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 6bc0e87f5a4ee50ad1b5f43743163c65304fa4c033903f932a1689cd40907bf2
MD5 f77aa992e85319627311f799de7dd6e6
BLAKE2b-256 9f6d39a65f985fa85f04148656fdc2a83e433b098bd0cc7757e9710ec63b773a

See more details on using hashes here.

File details

Details for the file rust_dtw-0.1.14-cp37-cp37m-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for rust_dtw-0.1.14-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 a5c9d2a0e6c10f39c264442897f298f855f668e5bc427aa3e75bef4e56b6035e
MD5 1241876bd99aaf145d52ef19e6deecf9
BLAKE2b-256 5ae3354687f8c1d8f860b93ecbc808638d4b9fa0850127efb17ee271d087a474

See more details on using hashes here.

File details

Details for the file rust_dtw-0.1.14-cp36-none-win_amd64.whl.

File metadata

File hashes

Hashes for rust_dtw-0.1.14-cp36-none-win_amd64.whl
Algorithm Hash digest
SHA256 523c82a2768db0c7798160eeb55253a07bd2d423a37b19f22bd1c314f7e883ce
MD5 e0c75f807dbdb865c1962c406635e97d
BLAKE2b-256 8ed05594767f1f0f9f76c7904a5ecf9a47053e1179584ba1ff4561aa52be3a59

See more details on using hashes here.

File details

Details for the file rust_dtw-0.1.14-cp36-cp36m-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for rust_dtw-0.1.14-cp36-cp36m-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 1c080fb1b45f509fe4a3ebd5bb7b720e4ea1d34e2702ea3f3b3b246f6528c1e7
MD5 7600726ea3c24cf483714cc96fe163f9
BLAKE2b-256 7012463c7bd239e5714c404f90c36a9ee355fa89e618ac6f4d639c5ac472d80c

See more details on using hashes here.

File details

Details for the file rust_dtw-0.1.14-cp36-cp36m-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for rust_dtw-0.1.14-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 87624bd6ebb519a2f662afaf004a7d5f5bb2cc17215cc8ff94a00f3e4a6500e6
MD5 829db3789c6ebd2a7d52653a0e2e9409
BLAKE2b-256 410263306453dca92b5d5d3db75e2748ac362955a52bf7375ca506475d023adf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page