From: <js...@us...> - 2009-11-14 15:57:56
|
Revision: 7965 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7965&view=rev Author: jswhit Date: 2009-11-14 15:57:46 +0000 (Sat, 14 Nov 2009) Log Message: ----------- fix bug in griddata that occurs when mask is a scalar boolean (found by James Conners) Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/mlab.py Modified: trunk/matplotlib/lib/matplotlib/mlab.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mlab.py 2009-11-13 19:22:52 UTC (rev 7964) +++ trunk/matplotlib/lib/matplotlib/mlab.py 2009-11-14 15:57:46 UTC (rev 7965) @@ -2687,9 +2687,11 @@ raise TypeError("inputs x,y,z must all be 1D arrays of the same length") # remove masked points. if hasattr(z,'mask'): - x = x.compress(z.mask == False) - y = y.compress(z.mask == False) - z = z.compressed() + # make sure mask is not a scalar boolean array. + if a.mask.ndim: + x = x.compress(z.mask == False) + y = y.compress(z.mask == False) + z = z.compressed() if _use_natgrid: # use natgrid toolkit if available. if interp != 'nn': raise ValueError("only natural neighor interpolation" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |