[Scipy-svn] r4457 - trunk/scipy/ndimage/tests

scipy-svn@scip... scipy-svn@scip...
Sat Jun 21 11:48:52 CDT 2008


Author: cdavid
Date: 2008-06-21 11:48:48 -0500 (Sat, 21 Jun 2008)
New Revision: 4457

Added:
   trunk/scipy/ndimage/tests/test_regression.py
Log:
Add regression test for #413.

Added: trunk/scipy/ndimage/tests/test_regression.py
===================================================================
--- trunk/scipy/ndimage/tests/test_regression.py	2008-06-21 11:28:01 UTC (rev 4456)
+++ trunk/scipy/ndimage/tests/test_regression.py	2008-06-21 16:48:48 UTC (rev 4457)
@@ -0,0 +1,15 @@
+import numpy as np
+from numpy.testing import *
+    
+import scipy.ndimage as ndimage
+
+def test_byte_order_median():
+    """Regression test for #413: median_filter does not handle bytes orders."""
+    a = np.arange(9, dtype='<f4').reshape(3, 3)
+    ref = ndimage.filters.median_filter(a,(3, 3))
+    b = np.arange(9, dtype='>f4').reshape(3, 3)
+    t = ndimage.filters.median_filter(b, (3, 3))
+    assert_array_almost_equal(ref, t)
+
+if __name__ == "__main__":
+    NumpyTest().run()



More information about the Scipy-svn mailing list