Skip to content

Commit 3de6746

Browse files
authored
Merge pull request #398 from efiring/no_is_scalar
Remove incompatibility with mpl v3.x
2 parents 2024d05 + f0758a1 commit 3de6746

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/mpl_toolkits/basemap/__init__.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from urllib.request import urlretrieve, urlopen
2424

2525
from matplotlib import __version__ as _matplotlib_version
26-
from matplotlib.cbook import is_scalar, dedent
26+
from matplotlib.cbook import dedent
2727
# check to make sure matplotlib is not too old.
2828
_matplotlib_version = LooseVersion(_matplotlib_version)
2929
_mpl_required_version = LooseVersion('0.98')
@@ -4989,12 +4989,11 @@ def interp(datain,xin,yin,xout,yout,checkbounds=False,masked=False,order=1):
49894989
dataout = map_coordinates(datain,coords,order=3,mode='nearest')
49904990
else:
49914991
raise ValueError('order keyword must be 0, 1 or 3')
4992-
if masked and isinstance(masked,bool):
4993-
dataout = ma.masked_array(dataout)
4992+
if masked:
49944993
newmask = ma.mask_or(ma.getmask(dataout), xymask)
4995-
dataout = ma.masked_array(dataout,mask=newmask)
4996-
elif masked and is_scalar(masked):
4997-
dataout = np.where(xymask,masked,dataout)
4994+
dataout = ma.masked_array(dataout, mask=newmask)
4995+
if not isinstance(masked, bool):
4996+
dataout = dataout.filled(masked)
49984997
return dataout
49994998

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

0 commit comments

Comments
 (0)