[Scipy-svn] r4980 - trunk/scipy/signal/tests

scipy-svn at scipy.org scipy-svn at scipy.org
Tue Nov 4 01:03:32 EST 2008


Author: cdavid
Date: 2008-11-04 00:03:23 -0600 (Tue, 04 Nov 2008)
New Revision: 4980

Modified:
   trunk/scipy/signal/tests/test_signaltools.py
Log:
Add a simple test for lfilter on rank 3 arrays (skipped since it segfaults lfilter).

Modified: trunk/scipy/signal/tests/test_signaltools.py
===================================================================
--- trunk/scipy/signal/tests/test_signaltools.py	2008-11-04 05:48:37 UTC (rev 4979)
+++ trunk/scipy/signal/tests/test_signaltools.py	2008-11-04 06:03:23 UTC (rev 4980)
@@ -167,5 +167,20 @@
         #assert_array_almost_equal(y_r2_a0_0, y)
         #assert_array_almost_equal(zf, zf_r)
 
+    # Disabled because it crashes lfilter for now
+    @dec.skipif(True, "Skipping rank > 2 test for lfilter because its segfaults ATM")
+    def test_rank3(self):
+        shape = (4, 3, 2)
+        x = np.linspace(0, np.prod(shape) - 1, np.prod(shape)).reshape(shape)
+
+        b = np.array([1, -1])
+        a = np.array([0.5, 0.5])
+
+        # Test last axis
+        y = lfilter(b, a, x)
+        for i in range(x.shape[0]):
+            for j in range(x.shape[1]):
+                assert_array_almost_equal(y[i, j], lfilter(b, a, x[i, j]))
+
 if __name__ == "__main__":
     run_module_suite()




More information about the Scipy-svn mailing list