[Scipy-svn] r6858 - trunk/scipy/signal

scipy-svn@scip... scipy-svn@scip...
Tue Nov 2 01:05:12 CDT 2010


Author: warren.weckesser
Date: 2010-11-02 01:05:10 -0500 (Tue, 02 Nov 2010)
New Revision: 6858

Modified:
   trunk/scipy/signal/bsplines.py
Log:
ENH: signal: In bsplines.py, don't use 'import *', and update 'raise' statements.

Modified: trunk/scipy/signal/bsplines.py
===================================================================
--- trunk/scipy/signal/bsplines.py	2010-11-02 05:44:28 UTC (rev 6857)
+++ trunk/scipy/signal/bsplines.py	2010-11-02 06:05:10 UTC (rev 6858)
@@ -4,10 +4,15 @@
      piecewise, array, arctan2, tan, zeros, arange, floor
 from numpy.core.umath import sqrt, exp, greater, less, cos, add, sin, \
      less_equal, greater_equal
-from spline import *      # C-modules
+
+# From splinemodule.c
+from spline import cspline2d, qspline2d, sepfir2d, symiirorder1, symiirorder2
+
 from scipy.misc import comb
 
+
 gamma = scipy.special.gamma
+
 def factorial(n):
     return gamma(n+1)
 
@@ -31,7 +36,7 @@
         out = sepfir2d(ckr, hcol, hcol)
         out = out.astype(intype)
     else:
-        raise TypeError;
+        raise TypeError("Invalid data type for Iin")
     return out
 
 _splinefunc_cache = {}
@@ -181,7 +186,7 @@
         c0 = 5040
         P = array([1,120,1191,2416,1191, 120, 1])
     else:
-        raise ValueError, "Unknown order."
+        raise ValueError("Unknown order %d" % order)
 
 def _coeff_smooth(lam):
     xi = 1 - 96*lam + 24*lam * sqrt(3 + 144*lam)
@@ -302,7 +307,7 @@
         Cubic spline coefficients.
     """
     if lamb != 0.0:
-        raise ValueError, "Smoothing quadratic splines not supported yet."
+        raise ValueError("Smoothing quadratic splines not supported yet.")
     else:
         return _quadratic_coeff(signal)
 



More information about the Scipy-svn mailing list