[Scipy-svn] r6250 - in trunk/scipy/signal: . tests

scipy-svn@scip... scipy-svn@scip...
Wed Feb 24 06:27:43 CST 2010


Author: stefan
Date: 2010-02-24 06:27:43 -0600 (Wed, 24 Feb 2010)
New Revision: 6250

Modified:
   trunk/scipy/signal/signaltools.py
   trunk/scipy/signal/tests/test_signaltools.py
Log:
BUG: Medfilt segfaults on None input. Closes #1124.

Modified: trunk/scipy/signal/signaltools.py
===================================================================
--- trunk/scipy/signal/signaltools.py	2010-02-22 20:29:35 UTC (rev 6249)
+++ trunk/scipy/signal/signaltools.py	2010-02-24 12:27:43 UTC (rev 6250)
@@ -291,7 +291,7 @@
            result.
 
     """
-    volume = asarray(volume)
+    volume = atleast_1d(volume)
     if kernel_size is None:
         kernel_size = [3] * len(volume.shape)
     kernel_size = asarray(kernel_size)

Modified: trunk/scipy/signal/tests/test_signaltools.py
===================================================================
--- trunk/scipy/signal/tests/test_signaltools.py	2010-02-22 20:29:35 UTC (rev 6249)
+++ trunk/scipy/signal/tests/test_signaltools.py	2010-02-24 12:27:43 UTC (rev 6250)
@@ -280,6 +280,10 @@
                                [ 0,  7, 11,  7,  4,  4, 19, 19, 24,  0]])
         assert_array_equal(d, e)
 
+    def test_none(self):
+        """Ticket #1124."""
+        signal.medfilt(None)
+
 class TestWiener(TestCase):
     def test_basic(self):
         g = array([[5,6,4,3],[3,5,6,2],[2,3,5,6],[1,6,9,7]],'d')
@@ -781,8 +785,6 @@
                              9.444121133484362e-17-0.79252210110103j ])
         yield assert_almost_equal, aan[0], a0hilb, 14, 'N regression'
 
-        
 
-
 if __name__ == "__main__":
     run_module_suite()



More information about the Scipy-svn mailing list