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

scipy-svn at scipy.org scipy-svn at scipy.org
Sat Jan 15 07:42:41 EST 2011


Author: rgommers
Date: 2011-01-15 06:42:40 -0600 (Sat, 15 Jan 2011)
New Revision: 7035

Modified:
   trunk/scipy/interpolate/tests/test_rbf.py
Log:
TST: silence floating point test noise in interpolate.

Modified: trunk/scipy/interpolate/tests/test_rbf.py
===================================================================
--- trunk/scipy/interpolate/tests/test_rbf.py	2011-01-15 03:28:40 UTC (rev 7034)
+++ trunk/scipy/interpolate/tests/test_rbf.py	2011-01-15 12:42:40 UTC (rev 7035)
@@ -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_, assert_array_almost_equal, assert_almost_equal
 from numpy import linspace, sin, random, exp, allclose
 from scipy.interpolate.rbf import Rbf
@@ -40,10 +41,14 @@
     assert_array_almost_equal(di, d)
 
 def test_rbf_interpolation():
-    for function in FUNCTIONS:
-        yield check_rbf1d_interpolation, function
-        yield check_rbf2d_interpolation, function
-        yield check_rbf3d_interpolation, function
+    olderr = np.seterr(all="ignore")
+    try:
+        for function in FUNCTIONS:
+            yield check_rbf1d_interpolation, function
+            yield check_rbf2d_interpolation, function
+            yield check_rbf3d_interpolation, function
+    finally:
+        np.seterr(**olderr)
 
 def check_rbf1d_regularity(function, atol):
     """Check that the Rbf function approximates a smooth function well away
@@ -71,8 +76,12 @@
         'thin-plate': 0.1,
         'linear': 0.2
     }
-    for function in FUNCTIONS:
-        yield check_rbf1d_regularity, function, tolerances.get(function, 1e-2)
+    olderr = np.seterr(all="ignore")
+    try:
+        for function in FUNCTIONS:
+            yield check_rbf1d_regularity, function, tolerances.get(function, 1e-2)
+    finally:
+        np.seterr(**olderr)
 
 def test_default_construction():
     """Check that the Rbf class can be constructed with the default




More information about the Scipy-svn mailing list