# [Scipy-svn] r6857 - trunk/scipy/signal

scipy-svn@scip... scipy-svn@scip...
Tue Nov 2 00:44:29 CDT 2010

Author: warren.weckesser
Date: 2010-11-02 00:44:28 -0500 (Tue, 02 Nov 2010)
New Revision: 6857

Modified:
trunk/scipy/signal/wavelets.py
trunk/scipy/signal/windows.py
Log:
Remove an unused import.  Update 'raise' syntax.

Modified: trunk/scipy/signal/wavelets.py
===================================================================
--- trunk/scipy/signal/wavelets.py	2010-10-25 20:10:06 UTC (rev 6856)
+++ trunk/scipy/signal/wavelets.py	2010-11-02 05:44:28 UTC (rev 6857)
@@ -62,8 +62,8 @@
q = q / np.sum(q) * sqrt(2)
return q.c[::-1]
else:
-        raise ValueError, "Polynomial factorization does not work "\
-              "well for p too large."
+        raise ValueError("Polynomial factorization does not work "
+              "well for p too large.")

def qmf(hk):
"""Return high-pass qmf filter from low-pass
@@ -118,9 +118,9 @@
N = len(hk)-1

if (J > 30 - np.log2(N+1)):
-        raise ValueError, "Too many levels."
+        raise ValueError("Too many levels.")
if (J < 1):
-        raise ValueError, "Too few levels."
+        raise ValueError("Too few levels.")

# construct matrices needed

Modified: trunk/scipy/signal/windows.py
===================================================================
--- trunk/scipy/signal/windows.py	2010-10-25 20:10:06 UTC (rev 6856)
+++ trunk/scipy/signal/windows.py	2010-11-02 05:44:28 UTC (rev 6857)
@@ -1,7 +1,5 @@
"""The suite of window functions."""

-import types
-
import numpy as np
from scipy import special, linalg
from scipy.fftpack import fft
@@ -340,8 +338,8 @@

"""
if (M*width > 27.38):
-        raise ValueError, "Cannot reliably obtain slepian sequences for"\
-              " M*width > 27.38."
+        raise ValueError("Cannot reliably obtain slepian sequences for"
+              " M*width > 27.38.")
if M < 1:
return np.array([])
if M == 1:
@@ -473,7 +471,7 @@
elif winstr in ['chebwin', 'cheb']:
winfunc = chebwin
else:
-            raise ValueError, "Unknown window type."
+            raise ValueError("Unknown window type.")

params = (Nx,) + args + (sym,)
else: