Skip to main content

dtw_metrics

Dynamic time warping metrics.

python 3.11 pre-commit pre-commit.ci status linter Code style: black Imports: isort pydocstyle License: MIT

Description

Dynamic time warping (DTW) is an algorithm used to measure similarity between different data series, which may vary in speed.

Setup

Makefile

Setup via Makefile:

  • Clone the repository first.

  • Help and overview of commands:

    make help
    
  • Setup (Create the venv, install libraries and pull minimal data setup):

    make setup
    
  • Activate Python venv:

    make venv
    
  • Clean project:

    make clean
    

Python venv (Poetry)

  • Poetry is used for the virtual Python environment.
    • Install python poetry:

      curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
      

      or

      pip install --user poetry
      
    • Make sure that the virtual environment is installed in the root folder of this projects:

      poetry config virtualenvs.in-project true
      
    • Install dependencies:

      poetry install --no-root
      
    • Add packages: To add further packages, run:

      poetry add <package-name>
      

Code formatting

  • Formatting via pre-commit hook: Python code is formatted using pre-commit hooks.

  • Install pre-commit:

    pip install pre-commit
    

    or

    brew install pre-commit
    
  • Install pre-commit hooks from the config file .pre-commit-config.yaml

    pre-commit install
    
  • Run the pre-commit hooks:

    pre-commit run -a
    

Code testing

Testing is done with pytest. The pytest package is already installed in the poetry venv.

  • Run all tests:

    pytest
    
  • Run individual tests:

    pytest <path-to-test-files>
    

Usage

  • Example files in /examples/

Examples

Symmetric P1 step pattern

Example image Fig 1: Compared time series and warped sequence.

Example image Fig 2: Cost matrix and optimal warping path.

Example image Fig 3: Accumulated cost matrix and optimal warping path.

Symmetric P0 step pattern

Example image Fig 1: Compared time series and warped sequence.

Example image Fig 2: Cost matrix and optimal warping path.

Example image Fig 3: Accumulated cost matrix and optimal warping path.

References

Metadata

Release files for dtwmetrics 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dtwmetrics 0.1.2
File Size Uploaded Provenance
dtwmetrics-0.1.2.tar.gz 8.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for dtwmetrics 0.1.2
File Interpreter ABI Platform
dtwmetrics-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 17.9 kB

Release files / dtwmetrics-0.1.2.tar.gz

Download URL dtwmetrics-0.1.2.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
883ea6ede744edaf4397564c72c4e28483090aa2a64fd5c69951567e24e66b13
BLAKE2b-256 checksum
How to use checksums
31cac4a4d2df5edd41c081fa106e4eeb230e0f87f94e85efb862d123c9c4d367
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / dtwmetrics-0.1.2-py3-none-any.whl

Download URL dtwmetrics-0.1.2-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d78e83d0eef4ae088e9a922d91374662b86c6ac685f2677d7d8296f037b9c1e5
BLAKE2b-256 checksum
How to use checksums
61e6326a7f8c917faecb8c2d028f6f3c1e1a151f34a275acd97c5b43bb56c339
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.6

Security for dtwmetrics 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page