[Scipy-svn] r4627 - branches/stats_models

scipy-svn@scip... scipy-svn@scip...
Fri Aug 8 15:06:42 CDT 2008


Author: chris.burns
Date: 2008-08-08 15:06:36 -0500 (Fri, 08 Aug 2008)
New Revision: 4627

Modified:
   branches/stats_models/TODO.txt
   branches/stats_models/smoothers.py
Log:
Fix invalid imports.  Add note to TODO regarding code duplication.

Modified: branches/stats_models/TODO.txt
===================================================================
--- branches/stats_models/TODO.txt	2008-08-08 19:55:31 UTC (rev 4626)
+++ branches/stats_models/TODO.txt	2008-08-08 20:06:36 UTC (rev 4627)
@@ -32,3 +32,5 @@
   at, most only checked attribute setting, not the results of applying
   the function to data.
 
+* Remove code duplication.  smoothers.py and bspline.py define
+  SmoothingSpline class.

Modified: branches/stats_models/smoothers.py
===================================================================
--- branches/stats_models/smoothers.py	2008-08-08 19:55:31 UTC (rev 4626)
+++ branches/stats_models/smoothers.py	2008-08-08 20:06:36 UTC (rev 4627)
@@ -9,10 +9,9 @@
 from scipy.linalg import solveh_banded
 from scipy.optimize import golden
 
-from scipy.stats.models import _bspline
-from scipy.stats.models.bspline import bspline, _band2array
+from scipy.stats.models import _hbspline
+from scipy.stats.models.bspline import BSpline, _band2array
 
-
 class PolySmoother:
     """
     Polynomial smoother up to a given order.
@@ -61,7 +60,7 @@
         _y = y * _w
         self.coef = N.dot(L.pinv(X).T, _y)
 
-class SmoothingSpline(bspline):
+class SmoothingSpline(BSpline):
 
     penmax = 30.
 
@@ -153,7 +152,7 @@
         """
 
         if self.pen > 0:
-            _invband = _bspline.invband(self.chol.copy())
+            _invband = _hbspline.invband(self.chol.copy())
             tr = _trace_symbanded(_invband, self.btb, lower=1)
             return tr
         else:
@@ -174,7 +173,7 @@
     def __init__(self, knots, order=4, coef=None, M=None, target_df=None):
         if target_df is not None:
             self.target_df = target_df
-        bspline.__init__(self, knots, order=order, coef=coef, M=M)
+        BSpline.__init__(self, knots, order=order, coef=coef, M=M)
         self.target_reached = False
 
     def fit(self, y, x=None, df=None, weights=None, tol=1.0e-03):



More information about the Scipy-svn mailing list