mrgeorge / BusTripper

Identify bus trips from GPS locations
3 stars 1 forks source link

DeprecationWarning: using a non-integer number instead of an integer will result in an error in the future #16

Closed mrgeorge closed 10 years ago

mrgeorge commented 10 years ago

I traced this issue to scipy.integrate.simps which is called in tripDistances.avgMillisFromBlock

It appears to be a warning new in numpy 1.8, so may be version specific (e.g. http://stackoverflow.com/questions/20084218/deprecation-warning-in-scikit-learn-svmlight-format-loader)

To avoid the warning, I changed a line in /path/to/scipy/integrate/quadrature.py L356. shapex = ones(nd) becomes shapex = ones(nd, dtype='int64')

The problem is that np.ones by default creates a float64 array, and now numpy warns when floats are used as indices, so casting as ints upon creation avoids the problem. This probably appears in a bunch of places in scipy and I haven't tried to fix it anywhere else.