[Scipy-svn] r6601 - in branches/0.8.x/scipy/interpolate: . tests

scipy-svn at scipy.org scipy-svn at scipy.org
Tue Jul 13 09:07:43 EDT 2010


Author: rgommers
Date: 2010-07-13 08:07:43 -0500 (Tue, 13 Jul 2010)
New Revision: 6601

Modified:
   branches/0.8.x/scipy/interpolate/rbf.py
   branches/0.8.x/scipy/interpolate/tests/test_rbf.py
Log:
BUG: Fix and regression test for ticket #1228 (in Rbf, by Scott Sinclair).

(cherry-picked from r6599)

Modified: branches/0.8.x/scipy/interpolate/rbf.py
===================================================================
--- branches/0.8.x/scipy/interpolate/rbf.py	2010-07-13 13:07:14 UTC (rev 6600)
+++ branches/0.8.x/scipy/interpolate/rbf.py	2010-07-13 13:07:43 UTC (rev 6601)
@@ -180,7 +180,7 @@
         self.epsilon = kwargs.pop('epsilon', r.mean())
         self.smooth = kwargs.pop('smooth', 0.0)
 
-        self.function = kwargs.pop('function', self._h_multiquadric)
+        self.function = kwargs.pop('function', 'multiquadric')
 
         # attach anything left in kwargs to self
         #  for use by any user-callable function or 

Modified: branches/0.8.x/scipy/interpolate/tests/test_rbf.py
===================================================================
--- branches/0.8.x/scipy/interpolate/tests/test_rbf.py	2010-07-13 13:07:14 UTC (rev 6600)
+++ branches/0.8.x/scipy/interpolate/tests/test_rbf.py	2010-07-13 13:07:43 UTC (rev 6601)
@@ -74,3 +74,13 @@
     }
     for function in FUNCTIONS:
         yield check_rbf1d_regularity, function, tolerances.get(function, 1e-2)
+
+def test_default_construction():
+    """Check that the Rbf class can be constructed with the default
+    multiquadric basis function. Regression test for ticket #1228."""
+    x = linspace(0,10,9)
+    y = sin(x)
+    rbf = Rbf(x, y)
+    yi = rbf(x)
+    assert_array_almost_equal(y, yi)
+    




More information about the Scipy-svn mailing list