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

scipy-svn at scipy.org scipy-svn at scipy.org
Sat Sep 11 20:56:43 EDT 2010


Author: ptvirtan
Date: 2010-09-11 19:56:43 -0500 (Sat, 11 Sep 2010)
New Revision: 6744

Modified:
   trunk/scipy/ndimage/tests/test_ndimage.py
Log:
3K: ndimage/tests: fix a few integer division issues

Modified: trunk/scipy/ndimage/tests/test_ndimage.py
===================================================================
--- trunk/scipy/ndimage/tests/test_ndimage.py	2010-09-12 00:56:29 UTC (rev 6743)
+++ trunk/scipy/ndimage/tests/test_ndimage.py	2010-09-12 00:56:43 UTC (rev 6744)
@@ -1147,11 +1147,13 @@
         for type in self.types:
             a = numpy.arange(12, dtype = type)
             a.shape = (3,4)
-            r1 = ndimage.correlate(a, filter_ * footprint) / 5
+            r1 = ndimage.correlate(a, filter_ * footprint)
+            r1 /= 5
             r2 = ndimage.generic_filter(a, _filter_func,
                             footprint = footprint, extra_arguments = (cf,),
                             extra_keywords = {'total': cf.sum()})
-            self.failUnless(diff(r1, r2) < eps)
+            self.failUnless(diff(r1, r2) < eps,
+                            "%r\n%r" % (r1, r2))
 
     def test_extend01(self):
         "line extension 1"
@@ -1621,11 +1623,12 @@
         "geometric transform 13"
         data = numpy.ones([2], numpy.float64)
         def mapping(x):
-            return (x[0] / 2,)
+            return (x[0] // 2,)
         for order in range(0, 6):
             out = ndimage.geometric_transform(data, mapping,
                                                         [4], order=order)
-            self.failUnless(diff(out, [1, 1, 1, 1]) < eps)
+            self.failUnless(diff(out, [1, 1, 1, 1]) < eps,
+                            "%r" % out)
 
     def test_geometric_transform14(self):
         "geometric transform 14"




More information about the Scipy-svn mailing list