[Scipy-tickets] [SciPy] #1125: interpolate.interpolate.splmake calls helpers which raise NotImplementedError

SciPy Trac scipy-tickets@scipy....
Tue Mar 22 04:55:03 CDT 2011


#1125: interpolate.interpolate.splmake calls helpers which raise
NotImplementedError
-----------------------------------------+----------------------------------
 Reporter:  dgoldsmith                   |       Owner:  somebody
     Type:  defect                       |      Status:  new     
 Priority:  normal                       |   Milestone:  0.9.0   
Component:  scipy.interpolate            |     Version:  0.7.0   
 Keywords:  splmake NotImplementedError  |  
-----------------------------------------+----------------------------------

Comment(by cycyc):

 Can confirm this error in versions 0.7.2 and 0.8.
 Any kind except 'smoothest' and 'user' results in

 {{{
 NotImplementedError                       Traceback (most recent call
 last)

 /home/ivan/.sage/<ipython console> in <module>()

 /home/ivan/apps/sage_4.6.2_64bit/local/lib/python2.6/site-
 packages/scipy/interpolate/interpolate.py in splmake(xk, yk, order, kind,
 conds)
     744     # the constraint matrix

     745     B = _fitpack._bsplmat(order, xk)
 --> 746     coefs = func(xk, yk, order, conds, B)
     747     return xk, coefs, order
     748

 /home/ivan/apps/sage_4.6.2_64bit/local/lib/python2.6/site-
 packages/scipy/interpolate/interpolate.py in _find_natural(xk, yk, order,
 conds, B)
     682 #  derivative at K-1 farthest separated points

     683 def _find_natural(xk, yk, order, conds, B):
 --> 684     raise NotImplementedError
     685     return _find_user(xk, yk, order, conds, B)
     686

 NotImplementedError:

 }}}


 Kind= 'User' results in

 {{{

 TypeError                                 Traceback (most recent call
 last)

 /home/ivan/.sage/<ipython console> in <module>()

 /home/ivan/apps/sage_4.6.2_64bit/local/lib/python2.6/site-
 packages/scipy/interpolate/interpolate.py in splmake(xk, yk, order, kind,
 conds)
     744     # the constraint matrix

     745     B = _fitpack._bsplmat(order, xk)
 --> 746     coefs = func(xk, yk, order, conds, B)
     747     return xk, coefs, order
     748

 /home/ivan/apps/sage_4.6.2_64bit/local/lib/python2.6/site-
 packages/scipy/interpolate/interpolate.py in _find_user(xk, yk, order,
 conds, B)
     661 #  of the additional equations to add to B

     662 def _find_user(xk, yk, order, conds, B):
 --> 663     lh = conds[0]
     664     rh = conds[1]
     665     B = concatenate((B,lh),axis=0)

 TypeError: 'NoneType' object is unsubscriptable
 }}}

 I would like to try some different options, since the normal output
 ('smoothest') just gives a straigt line (see attached picture) and
 "splrep" refuses to take the data:


 {{{
 xn =
 [0.,0.320262467985245,0.370435777969677,0.766861297758597,1.19079489837671,1.12565179340682,3.89159350395182]
   yn =
 [1.,1.29176198474867,1.29670939568530,1.21250532934149,1.37307263974328,1.48289386415960,2.85401527711149]
   spline = interpolate.splmake(xn, xn, kind='smoothest')
   spline= interpolate.splrep(xn,yn)
 ---------------------------------------------------------------------------
 ValueError                                Traceback (most recent call
 last)

 /home/ivan/.sage/<ipython console> in <module>()

 /home/ivan/apps/sage_4.6.2_64bit/local/lib/python2.6/site-
 packages/scipy/interpolate/fitpack.py in splrep(x, y, w, xb, xe, k, task,
 s, t, full_output, per, quiet)
     416         else:
     417             try:
 --> 418                 raise _iermess[ier][1],_iermess[ier][0]
     419             except KeyError:
     420                 raise
 _iermess['unknown'][1],_iermess['unknown'][0]

 ValueError:     Error on input data
 sage: spline= interpolate.splrep(xn,yn,full_output=True)
 sage: spline
 ((array([  6.90325867e-310,   4.47826793e-316,   5.05130108e-316,
          5.64276643e-316,   5.02421600e-316,   5.82580075e-316,
          0.00000000e+000,   0.00000000e+000,   0.00000000e+000,
          4.53125627e-316,   4.74303020e-322]), array([ 0.,  0.,  0.,  0.,
 0.,  0.,  0.,  0.,  0.,  0.,  0.]), 3), 0.0, 10, '    Error on input
 data')
  interpolate.splev(x,spline)
 ---------------------------------------------------------------------------
 ValueError                                Traceback (most recent call
 last)

 /home/ivan/.sage/<ipython console> in <module>()

 /home/ivan/apps/sage_4.6.2_64bit/local/lib/python2.6/site-
 packages/scipy/interpolate/fitpack.py in splev(x, tck, der)
     473
     474     """
 --> 475     t,c,k=tck
     476     try:
     477         c[0][0]

 ValueError: too many values to unpack
 }}}

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


More information about the Scipy-tickets mailing list