Skip to content

FastDTW fails to compile due to invalid fallback from numpy.math cimport INFINITY #65

@QuirkyCroissant

Description

@QuirkyCroissant

When building fastdtw from source (e.g., via python setup.py build_ext --inplace), the build fails with:

'numpy/math.pxd' not found

This is due to a fallback block in _fastdtw.pyx:

try:
    from libc.math cimport INFINITY
except:
    from numpy.math cimport INFINITY  # this file doesn't exist

Proposed fix: If I have not done something completely wrong, I replaced the block with the correct C import directly:

from libc.math cimport INFINITY

This resolves the build issue and enables the actual fast C extension to be used.
Let me know if you'd like me to submit a PR - happy to help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions