[Scipy-svn] r6522 - branches/0.8.x/scipy/special/tests

scipy-svn@scip... scipy-svn@scip...
Thu Jun 17 16:40:33 CDT 2010


Author: ptvirtan
Date: 2010-06-17 16:40:33 -0500 (Thu, 17 Jun 2010)
New Revision: 6522

Modified:
   branches/0.8.x/scipy/special/tests/test_basic.py
   branches/0.8.x/scipy/special/tests/test_data.py
Log:
BUG: special: adjust test tolerances to be more lenient about numerical differences on non-x86 platforms

(cherry picked from r6520)

Modified: branches/0.8.x/scipy/special/tests/test_basic.py
===================================================================
--- branches/0.8.x/scipy/special/tests/test_basic.py	2010-06-17 21:40:16 UTC (rev 6521)
+++ branches/0.8.x/scipy/special/tests/test_basic.py	2010-06-17 21:40:33 UTC (rev 6522)
@@ -1592,7 +1592,7 @@
         self.check_cephes_vs_amos(yv, yn, rtol=1e-11, atol=1e-305, skip=skipper)
 
     def test_iv_cephes_vs_amos(self):
-        self.check_cephes_vs_amos(iv, iv, rtol=1e-12, atol=1e-305)
+        self.check_cephes_vs_amos(iv, iv, rtol=5e-9, atol=1e-305)
 
     @dec.slow
     def test_iv_cephes_vs_amos_mass_test(self):
@@ -1607,6 +1607,10 @@
         c1 = iv(v, x)
         c2 = iv(v, x+0j)
 
+        # deal with differences in the inf cutoffs
+        c1[abs(c1) > 1e300] = np.inf
+        c2[abs(c2) > 1e300] = np.inf
+
         dc = abs(c1/c2 - 1)
         dc[np.isnan(dc)] = 0
 
@@ -1614,7 +1618,7 @@
 
         # Most error apparently comes from AMOS and not our implementation;
         # there are some problems near integer orders there
-        assert dc[k] < 1e-9, (iv(v[k], x[k]), iv(v[k], x[k]+0j))
+        assert dc[k] < 1e-9, (v[k], x[k], iv(v[k], x[k]), iv(v[k], x[k]+0j))
 
     def test_kv_cephes_vs_amos(self):
         #self.check_cephes_vs_amos(kv, kn, rtol=1e-9, atol=1e-305)

Modified: branches/0.8.x/scipy/special/tests/test_data.py
===================================================================
--- branches/0.8.x/scipy/special/tests/test_data.py	2010-06-17 21:40:16 UTC (rev 6521)
+++ branches/0.8.x/scipy/special/tests/test_data.py	2010-06-17 21:40:33 UTC (rev 6522)
@@ -140,7 +140,7 @@
         data(gammaincinv, 'gamma_inv_data_ipp-gamma_inv_data', (0,1), 2,
              rtol=1e-12),
         data(gammaincinv, 'gamma_inv_big_data_ipp-gamma_inv_big_data',
-             (0,1), 2, rtol=5e-12),
+             (0,1), 2, rtol=1e-11),
 
         # XXX: the data file needs reformatting...
         #data(gammaincinv, 'gamma_inv_small_data_ipp-gamma_inv_small_data',



More information about the Scipy-svn mailing list