[Scipy-svn] r6550 - trunk/scipy/special/tests

scipy-svn@scip... scipy-svn@scip...
Sun Jun 20 18:47:33 CDT 2010


Author: ptvirtan
Date: 2010-06-20 18:47:33 -0500 (Sun, 20 Jun 2010)
New Revision: 6550

Modified:
   trunk/scipy/special/tests/test_mpmath.py
Log:
TST: special: fix mpmath-based tests to pass on Python 2.4

Modified: trunk/scipy/special/tests/test_mpmath.py
===================================================================
--- trunk/scipy/special/tests/test_mpmath.py	2010-06-20 22:41:30 UTC (rev 6549)
+++ trunk/scipy/special/tests/test_mpmath.py	2010-06-20 23:47:33 UTC (rev 6550)
@@ -42,7 +42,7 @@
     for r in np.logspace(-99, 2, 10):
         for p in np.linspace(0, 2*np.pi, 30):
             z = r*np.exp(1j*p)
-            dataset.append((z, mpmath.ei(z)))
+            dataset.append((z, complex(mpmath.ei(z))))
     dataset = np.array(dataset, dtype=np.complex_)
 
     FuncData(sc.expi, dataset, 0, 1).check()
@@ -168,7 +168,7 @@
 
         # note that the global accuracy of our complex erf algorithm is limited
         # roughly to 2e-8
-        assert_func_equal(sc.erf, mpmath.erf, points, vectorized=False,
-                          rtol=2e-8)
+        assert_func_equal(sc.erf, lambda x: complex(mpmath.erf(x)), points,
+                          vectorized=False, rtol=2e-8)
     finally:
         mpmath.mp.dps, mpmath.mp.prec = old_dps, old_prec



More information about the Scipy-svn mailing list