[Scipy-svn] r4996 - trunk/scipy/interpolate/tests

scipy-svn@scip... scipy-svn@scip...
Wed Nov 5 05:19:01 CST 2008


Author: cdavid
Date: 2008-11-05 05:18:54 -0600 (Wed, 05 Nov 2008)
New Revision: 4996

Modified:
   trunk/scipy/interpolate/tests/test_rbf.py
Log:
Make sure decimal argument is an integer in assert_array_almost_equal to avoid spurious warnings.

Modified: trunk/scipy/interpolate/tests/test_rbf.py
===================================================================
--- trunk/scipy/interpolate/tests/test_rbf.py	2008-11-05 11:05:06 UTC (rev 4995)
+++ trunk/scipy/interpolate/tests/test_rbf.py	2008-11-05 11:18:54 UTC (rev 4996)
@@ -2,6 +2,7 @@
 # Created by John Travers, Robert Hetland, 2007
 """ Test functions for rbf module """
 
+import numpy as np
 from numpy.testing import assert_array_almost_equal, assert_almost_equal
 from numpy import linspace, sin, random, exp, log10
 from scipy.interpolate.rbf import Rbf
@@ -58,7 +59,7 @@
     #plt.plot(x, y, 'o', xi, sin(xi), ':', xi, yi, '-')
     #plt.title(function)
     #plt.show()
-    assert_array_almost_equal(yi, sin(xi), decimal=-log10(atol),
+    assert_array_almost_equal(yi, sin(xi), decimal=-np.int(log10(atol)) - 1,
                               err_msg="abs-diff: %f" % abs(yi - sin(xi)).max())
 
 def test_rbf_regularity():



More information about the Scipy-svn mailing list