Skip to content

Commit

Permalink
Merge pull request #398 from efiring/no_is_scalar
Browse files Browse the repository at this point in the history
Remove incompatibility with mpl v3.x
  • Loading branch information
WeatherGod committed Apr 28, 2018
2 parents 2024d05 + f0758a1 commit 3de6746
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/mpl_toolkits/basemap/__init__.py
Expand Up @@ -23,7 +23,7 @@
from urllib.request import urlretrieve, urlopen

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 @@ -4989,12 +4989,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

0 comments on commit 3de6746

Please sign in to comment.