Skip to content

Remove incompatibility with mpl v3.x #398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions lib/mpl_toolkits/basemap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"""
from distutils.version import LooseVersion
from matplotlib import __version__ as _matplotlib_version
from matplotlib.cbook import is_scalar, dedent
from matplotlib.cbook import dedent
# check to make sure matplotlib is not too old.
_matplotlib_version = LooseVersion(_matplotlib_version)
_mpl_required_version = LooseVersion('0.98')
Expand Down Expand Up @@ -4984,12 +4984,11 @@ def interp(datain,xin,yin,xout,yout,checkbounds=False,masked=False,order=1):
dataout = map_coordinates(datain,coords,order=3,mode='nearest')
else:
raise ValueError('order keyword must be 0, 1 or 3')
if masked and isinstance(masked,bool):
dataout = ma.masked_array(dataout)
if masked:
newmask = ma.mask_or(ma.getmask(dataout), xymask)
dataout = ma.masked_array(dataout,mask=newmask)
elif masked and is_scalar(masked):
dataout = np.where(xymask,masked,dataout)
dataout = ma.masked_array(dataout, mask=newmask)
if not isinstance(masked, bool):
dataout = dataout.filled(masked)
return dataout

def shiftgrid(lon0,datain,lonsin,start=True,cyclic=360.0):
Expand Down