python-osrm icon indicating copy to clipboard operation
python-osrm copied to clipboard

mlab.griddata deprecation!

Open fadikar opened this issue 5 years ago • 5 comments

ImportError: cannot import name 'griddata' from 'matplotlib.mlab'

fadikar avatar Feb 07 '20 05:02 fadikar

Hi @fadikar, Thank you for reporting this bug. Could you please provide a little bit of sample code to reproduce the issue?

ustroetz avatar Feb 11 '20 13:02 ustroetz

I am having the same issue. The error happens on the import osrm directly, matplotlib version is 3.1.3

MehdiSaffar avatar Feb 14 '20 09:02 MehdiSaffar

The problem happens when you have matplotlib version 3.1 or later, instead of 2.2.4 as noted in the requirements. I fixed this by using scipy's griddata instead, i.e. replacing

from matplotlib.mlab import griddata

with

from scipy.interpolate import griddata

in the file osrm/extra.py

DahnJ avatar Mar 12 '20 12:03 DahnJ

Just encountered this, thanks for the solutino @DahnJ

I see its in the master branch, is a new release to PyPi in the offing?

neilfloow avatar Nov 13 '20 19:11 neilfloow

last version of griddata call in https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.griddata.html has different syntax than currently in extra.py. PR upcoming

hannesaddec avatar May 11 '21 20:05 hannesaddec