Closed gitoops closed 5 years ago
@gitoops Thank you for pointing it out!
I made PR #8 which might solve this problem by fixing some of what you mentioned. Could you see it to find if it works?
I tried but unfortunately it doesen't compile out of the box´, falls back to install the pure python version.
Additionally I found with the version I compiled for Windows deviations depending on order of vectors: fastdtw(A,B) different to fastdtw(B,A). I would expect it should be the same. The pure python gives the correct solution independent of the order A,B or B,A. The test was with vectors of length 120, y values betwen 0 and 1000. Do you see the same issue with linux? Any idea what the problem causes?
Kind regards Jan
Okay, increasing the radius improved the precision and the distance A->B becomes B->A.
Current master is still broken on windows/cython. The reason is that stdc++ library does not exist. The module seems to compile and work fine if just removing this library reference. @slaypni please do that (I would, but don't know the "correct way" to do it within setup.py :) )
@shuffle2 I am also not good at writing setup.py.😭PR is welcome!
Seems to be fixed on Windows 10. I think you can close this issue.
@Seanny123 Thx!
Well, it's not fixed (how would it be with no changes?). I still had to remove stdc++ reference from setup.py
I had to do the following modifications:
classifiers = [ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Topic :: Scientific/Engineering' ]
extensions = [Extension( 'fastdtw._fastdtw', [os.path.join('fastdtw', "_fastdtw.pyx")], language="c++", include_dirs=[numpy.get_include()],
if you want to debug from MSVC IDE uncomment the following
extra_compile_args=["-Zi", "/Od"],
extra_link_args=["-debug"],
libraries=["stdc++","stdc"]
kwargs = { 'name': 'fastdtw', 'version': '0.3.0', 'author': 'Kazuaki Tanida', 'url': 'https://github.com/slaypni/fastdtw', 'description': 'Dynamic Time Warping (DTW) algorithm with an O(N) time and memory complexity.', 'license': 'MIT', 'keywords': ['dtw'], 'install_requires': ['numpy'], 'packages': find_packages(), 'ext_modules': cythonize(extensions), 'test_suite': 'tests', 'setup_requires': ['pytest-runner'], 'tests_require': ['pytest'], 'classifiers': classifiers }
try: setup(kwargs) except SystemExit: del kwargs['ext_modules'] warnings.warn('compilation failed. Installing pure python package') setup(kwargs)
from libc.math cimport INFINITY,pow, fabs
from libc.math cimport pow, fabs from numpy.math cimport INFINITY