[Scipy-svn] r6998 - trunk/scipy/optimize/tests

scipy-svn at scipy.org scipy-svn at scipy.org
Wed Dec 8 08:51:54 EST 2010


Author: rgommers
Date: 2010-12-08 07:51:53 -0600 (Wed, 08 Dec 2010)
New Revision: 6998

Modified:
   trunk/scipy/optimize/tests/test_optimize.py
Log:
TST: change criterion for fmin_ncg test. Closes #1323.

The number of gradient evaluations has a slight platform dependence due to
floating-point comparison differences. Number of calls is 18 on most platforms,
but has been reported as 16 in the ticket and on-list, with Python 2.7 and 2.5
respectively.

Modified: trunk/scipy/optimize/tests/test_optimize.py
===================================================================
--- trunk/scipy/optimize/tests/test_optimize.py	2010-12-05 06:39:11 UTC (rev 6997)
+++ trunk/scipy/optimize/tests/test_optimize.py	2010-12-08 13:51:53 UTC (rev 6998)
@@ -174,7 +174,8 @@
         # Ensure that function call counts are 'known good'; these are from
         # Scipy 0.7.0. Don't allow them to increase.
         assert_(self.funccalls == 7, self.funccalls)
-        assert_(self.gradcalls == 18, self.gradcalls) # 0.8.0
+        assert_(self.gradcalls <= 18, self.gradcalls) # 0.9.0
+        #assert_(self.gradcalls == 18, self.gradcalls) # 0.8.0
         #assert_(self.gradcalls == 22, self.gradcalls) # 0.7.0
 
         # Ensure that the function behaves the same; this is from Scipy 0.7.0
@@ -347,7 +348,7 @@
 
 
 class TestRosen(TestCase):
-    
+
     def test_hess(self):
         """Compare rosen_hess(x) times p with rosen_hess_prod(x,p) (ticket #1248)"""
         x = array([3, 4, 5])




More information about the Scipy-svn mailing list