Skip to content

Commit 6fe3666

Browse files
author
Jeff Whitaker
committed
make sure griddata issues verbose report only the first time it is called.
svn path=/trunk/matplotlib/; revision=5913
1 parent 46fe600 commit 6fe3666

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/matplotlib/mlab.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2603,10 +2603,12 @@ def griddata(x,y,z,xi,yi):
26032603
import matplotlib.delaunay as delaunay
26042604
from matplotlib.delaunay import __version__
26052605
_use_natgrid = False
2606-
if _use_natgrid:
2607-
verbose.report('using natgrid version %s' % __version__)
2608-
else:
2609-
verbose.report('using delaunay version %s' % __version__)
2606+
if not griddata._reported:
2607+
if _use_natgrid:
2608+
verbose.report('using natgrid version %s' % __version__)
2609+
else:
2610+
verbose.report('using delaunay version %s' % __version__)
2611+
griddata._reported = True
26102612
if xi.ndim != yi.ndim:
26112613
raise TypeError("inputs xi and yi must have same number of dimensions (1 or 2)")
26122614
if xi.ndim != 1 and xi.ndim != 2:
@@ -2645,3 +2647,4 @@ def griddata(x,y,z,xi,yi):
26452647
if np.any(np.isnan(zo)):
26462648
zo = np.ma.masked_where(np.isnan(zo),zo)
26472649
return zo
2650+
griddata._reported = False

0 commit comments

Comments
 (0)