mailr25283 - /trunk/test_suite/unit_tests/_target_functions/test_relax_fit.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on August 26, 2014 - 12:47:
Author: bugman
Date: Tue Aug 26 12:47:28 2014
New Revision: 25283

URL: http://svn.gna.org/viewcvs/relax?rev=25283&view=rev
Log:
Fix for the test_dfunc_off_minimum() unit test.

This is the test class 
test_suite.unit_tests._target_functions.test_relax_fit.Test_relax_fit.  The
wrong gradient was being scaled.


Modified:
    trunk/test_suite/unit_tests/_target_functions/test_relax_fit.py

Modified: trunk/test_suite/unit_tests/_target_functions/test_relax_fit.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/unit_tests/_target_functions/test_relax_fit.py?rev=25283&r1=25282&r2=25283&view=diff
==============================================================================
--- trunk/test_suite/unit_tests/_target_functions/test_relax_fit.py     
(original)
+++ trunk/test_suite/unit_tests/_target_functions/test_relax_fit.py     Tue 
Aug 26 12:47:28 2014
@@ -89,14 +89,12 @@
         R = 2.0
         params = [R/self.scaling_list[0], I0/self.scaling_list[1]]
 
-        # Get the chi-squared gradient, and scale it.
+        # Get the chi-squared gradient.
         grad = dfunc(params)
-        for i in range(2):
-            grad[i] *= self.scaling_list[i]
 
         # Printout.
-        print("The gradient at %s is:\n%s" % (params, grad))
+        print("The gradient at %s is:\n    %s" % (params, grad))
 
         # Check that the gradient matches the numerically derived values.
-        self.assertAlmostEqual(grad[0], 722.67864120737488)
-        self.assertAlmostEqual(grad[1], -11.564651301654292)
+        self.assertAlmostEqual(grad[0], 
456.36655522098829*self.scaling_list[0], 3)
+        self.assertAlmostEqual(grad[1], 
-10.8613338920982*self.scaling_list[1], 3)




Related Messages


Powered by MHonArc, Updated Tue Aug 26 13:00:02 2014