ustroetz / python-osrm

A Python wrapper around the OSRM API
MIT License
129 stars 53 forks source link

mlab.griddata deprecation! #40

Open fadikar opened 4 years ago

fadikar commented 4 years ago

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

ustroetz commented 4 years ago

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

MehdiSaffar commented 4 years ago

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

DahnJ commented 4 years ago

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

neilfloow commented 3 years ago

Just encountered this, thanks for the solutino @DahnJ

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

hannesaddec commented 3 years ago

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