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

scipy-svn@scip... scipy-svn@scip...
Thu Sep 18 14:15:50 CDT 2008


Author: alan.mcintyre
Date: 2008-09-18 14:15:47 -0500 (Thu, 18 Sep 2008)
New Revision: 4724

Modified:
   trunk/scipy/signal/bsplines.py
   trunk/scipy/signal/signaltools.py
   trunk/scipy/signal/wavelets.py
Log:
Removed unused imports.
Standardized NumPy import as "import numpy as np".


Modified: trunk/scipy/signal/bsplines.py
===================================================================
--- trunk/scipy/signal/bsplines.py	2008-09-18 19:12:41 UTC (rev 4723)
+++ trunk/scipy/signal/bsplines.py	2008-09-18 19:15:47 UTC (rev 4724)
@@ -3,7 +3,7 @@
 import scipy.special
 from numpy import logical_and, asarray, pi, zeros_like, \
      piecewise, array, arctan2, tan, zeros, arange, floor
-from numpy.core.umath import sqrt, exp, greater, less, equal, cos, add, sin, \
+from numpy.core.umath import sqrt, exp, greater, less, cos, add, sin, \
      less_equal, greater_equal
 from spline import *      # C-modules
 from scipy.misc import comb

Modified: trunk/scipy/signal/signaltools.py
===================================================================
--- trunk/scipy/signal/signaltools.py	2008-09-18 19:12:41 UTC (rev 4723)
+++ trunk/scipy/signal/signaltools.py	2008-09-18 19:15:47 UTC (rev 4724)
@@ -4,17 +4,16 @@
 import types
 import sigtools
 from scipy import special, linalg
-from scipy.fftpack import fft, ifft, ifftshift, fft2, ifft2
+from scipy.fftpack import fft, ifft, ifftshift, fft2, ifft2, fftn, ifftn
 from numpy import polyadd, polymul, polydiv, polysub, \
      roots, poly, polyval, polyder, cast, asarray, isscalar, atleast_1d, \
      ones, sin, linspace, real, extract, real_if_close, zeros, array, arange, \
      where, sqrt, rank, newaxis, argmax, product, cos, pi, exp, \
      ravel, size, less_equal, sum, r_, iscomplexobj, take, \
-     argsort, allclose, expand_dims, unique, prod, sort, reshape, c_, \
-     transpose, dot, any, minimum, maximum, mean, cosh, arccosh, \
+     argsort, allclose, expand_dims, unique, prod, sort, reshape, \
+     transpose, dot, any, mean, cosh, arccosh, \
      arccos, concatenate
-import numpy
-from scipy.fftpack import fftn, ifftn, fft
+import numpy as np
 from scipy.misc import factorial
 
 _modedict = {'valid':0, 'same':1, 'full':2}
@@ -94,8 +93,8 @@
     """
     s1 = array(in1.shape)
     s2 = array(in2.shape)
-    complex_result = (numpy.issubdtype(in1.dtype, numpy.complex) or
-                      numpy.issubdtype(in2.dtype, numpy.complex))
+    complex_result = (np.issubdtype(in1.dtype, np.complex) or
+                      np.issubdtype(in2.dtype, np.complex))
     size = s1+s2-1
     IN1 = fftn(in1,size)
     IN1 *= fftn(in2,size)
@@ -864,7 +863,7 @@
     p = zeros(x.shape)
     p[x > 1] = cosh(order * arccosh(x[x > 1]))
     p[x < -1] = (1 - 2*(order%2)) * cosh(order * arccosh(-x[x < -1]))
-    p[numpy.abs(x) <=1 ] = cos(order * arccos(x[numpy.abs(x) <= 1]))
+    p[np.abs(x) <=1 ] = cos(order * arccos(x[np.abs(x) <= 1]))
 
     # Appropriate IDFT and filling up
     # depending on even/odd M
@@ -1004,11 +1003,11 @@
       mult -- The multiplicity of each root
     """
     if rtype in ['max','maximum']:
-        comproot = numpy.maximum
+        comproot = np.maximum
     elif rtype in ['min','minimum']:
-        comproot = numpy.minimum
+        comproot = np.minimum
     elif rtype in ['avg','mean']:
-        comproot = numpy.mean
+        comproot = np.mean
     p = asarray(p)*1.0
     tol = abs(tol)
     p, indx = cmplx_sort(p)
@@ -1381,7 +1380,7 @@
     sl = [slice(None)]*len(x.shape)
     newshape = list(x.shape)
     newshape[axis] = num
-    N = int(numpy.minimum(num,Nx))
+    N = int(np.minimum(num,Nx))
     Y = zeros(newshape,'D')
     sl[axis] = slice(0,(N+1)/2)
     Y[sl] = X[sl]

Modified: trunk/scipy/signal/wavelets.py
===================================================================
--- trunk/scipy/signal/wavelets.py	2008-09-18 19:12:41 UTC (rev 4723)
+++ trunk/scipy/signal/wavelets.py	2008-09-18 19:15:47 UTC (rev 4724)
@@ -3,7 +3,7 @@
 import numpy as np
 from numpy.dual import eig
 from scipy.misc import comb
-from scipy import linspace, pi, exp, zeros
+from scipy import linspace, pi, exp
 
 def daub(p):
     """The coefficients for the FIR low-pass filter producing Daubechies wavelets.



More information about the Scipy-svn mailing list