How slaypni/fastdtw works
Project type and purpose
• Its primary purpose is to expose a fastdtw function to Python users, wrapping a C++ core for linear-time and memory DTW computation.
File structure
• Top level:
• setup.py, setup.cfg, Pipfile/Pipfile.lock, MANIFEST.in for packaging and dependency management.
• README.rst, LICENSE for documentation and licensing.
• fastdtw/ directory containing the library code:
– _fastdtw.cpp – native C++ implementation of the core algorithm.
– _fastdtw.pyx – Cython wrapper bridging C++ and Python.
– fastdtw.py – pure-Python fallback or driver code, including the high-level fastdtw() function.
– __init__.py – module exports.
• tests/ directory with unit tests (test_fastdtw.py).
README for additional insights
• Dependencies: numpy arrays as input, scipy.spatial.distance for distance metrics.
• Usage pattern: call fastdtw(x, y, dist=euclidean) to compute (distance, path).