# [Scipy-tickets] [SciPy] #1228: Radial Basis Function behaviour change between 0.7.2 and 0.8.x/trunk

SciPy Trac scipy-tickets@scipy....
Mon Jul 12 02:46:03 CDT 2010

```#1228: Radial Basis Function behaviour change between 0.7.2 and 0.8.x/trunk
-------------------------------+--------------------------------------------
Reporter:  ScottSinclair      |       Owner:  somebody
Type:  defect             |      Status:  new
Priority:  normal             |   Milestone:  0.8.0
Component:  scipy.interpolate  |     Version:  0.7.0
Keywords:                     |
-------------------------------+--------------------------------------------
The behaviour of the Rbf class changes between 0.7.2 and
0.8.x/trunk. The following code works in 0.7.2

{{{
>>> import numpy as np
>>> from scipy.interpolate import Rbf
>>> x = np.linspace(0, 10, 9)
>>> y = np.sin(x)
>>> rbf = Rbf(x, y)

}}}

but results in the following error with 0.8.x and trunk.

{{{
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call
last)

/home/scott/<ipython console> in <module>()

/home/scott/lib/python/scipy/interpolate/rbf.pyc in __init__(self, *args,
**kwargs)
189             setattr(self, item, value)
190
--> 191         self.A = self._init_function(r) - eye(self.N)*self.smooth
192         self.nodes = linalg.solve(self.A, self.di)
193

/home/scott/lib/python/scipy/interpolate/rbf.pyc in _init_function(self,
r)
162                 raise ValueError, "Function argument must take 1
or 2 arguments."
163
--> 164         a0 = self._function(r)
165         if a0.shape != r.shape:
166             raise ValueError, "Callable must take array and return
array of the same shape"

TypeError: _h_multiquadric() takes exactly 2 arguments (3 given)

}}}

A patch with
regression test is attached. The change in behavior was introduced with
r6215 (addition of ability to use user defined basis functions).

--
Ticket URL: <http://projects.scipy.org/scipy/ticket/1228>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.
```