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

scipy-svn@scip... scipy-svn@scip...
Tue Nov 4 00:03:55 CST 2008


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

Modified:
   trunk/scipy/signal/tests/test_signaltools.py
Log:
Use explicit failure instead of comment so that I don't forget to re-enable them once lfilter is fixed.

Modified: trunk/scipy/signal/tests/test_signaltools.py
===================================================================
--- trunk/scipy/signal/tests/test_signaltools.py	2008-11-04 06:03:23 UTC (rev 4980)
+++ trunk/scipy/signal/tests/test_signaltools.py	2008-11-04 06:03:46 UTC (rev 4981)
@@ -152,7 +152,14 @@
         y = lfilter(b, a, x, axis = 1)
         assert_array_almost_equal(y_r2_a1, y)
 
-        # Test initial condition handling
+    def test_rank2_init_cond_a1(self):
+        # Test initial condition handling along axis 1
+        shape = (4, 3)
+        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])
+
         y_r2_a0_1 = np.array([[1, 1, 1], [7, -5, 7], [13, -11, 13],
                               [19, -17, 19]])
         zf_r = np.array([-5, -17, -29, -41])[:, np.newaxis]
@@ -160,13 +167,23 @@
         assert_array_almost_equal(y_r2_a0_1, y)
         assert_array_almost_equal(zf, zf_r)
 
-        # XXX: disabled because it segfaults ATM
-        #y_r2_a0_0 = np.array([[1, 3, 5], [5, 3, 1], [1, 3, 5], [5 ,3 ,1]])
-        #zf_r = np.array([-23, -23, -23])
-        #y, zf = lfilter(b, a, x, axis = 0, zi = np.ones((1, 3)))
-        #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 lfilter test with initial condition along "\
+                      "axis 0: it segfaults ATM")
+    def test_rank2_init_cond_a0(self):
+        # Test initial condition handling along axis 0
+        shape = (4, 3)
+        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])
+
+        y_r2_a0_0 = np.array([[1, 3, 5], [5, 3, 1], [1, 3, 5], [5 ,3 ,1]])
+        zf_r = np.array([-23, -23, -23])
+        y, zf = lfilter(b, a, x, axis = 0, zi = np.ones((1, 3)))
+        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):



More information about the Scipy-svn mailing list