slaypni / fastdtw

A Python implementation of FastDTW
MIT License
774 stars 122 forks source link

replace np.float with np.floating to mitigate FutureWarning #19

Closed colobas closed 5 years ago

colobas commented 6 years ago

Call to np.issubdtype here, with np.float instead of np.floating raises the following FutureWarning:

FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.

python version: 3.6.4 numpy version: 1.14.2


Example:

Python 3.6.4 (default, Jan  5 2018, 02:35:40) 
[GCC 7.2.1 20171224] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> from scipy.spatial.distance import euclidean
>>> 
>>> from fastdtw import fastdtw
>>> 
>>> x = np.array([[1,1], [2,2], [3,3], [4,4], [5,5]])
>>> y = np.array([[2,2], [3,3], [4,4]])
>>> distance, path = fastdtw(x, y)
__main__:1: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
>>> print(distance)
4.0
>>> 
slaypni commented 5 years ago

Thanks!