Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

TST: check that callback works for TNC

  • Loading branch information...
commit 00f64f4ccaa076cf225ca53c24c68fbe66ae39e0 1 parent 0f9316f
@dlax dlax authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 scipy/optimize/tests/test_optimize.py
View
9 scipy/optimize/tests/test_optimize.py
@@ -722,10 +722,11 @@ def test_minimize_tnc1(self):
xopt = [1, 1]
iterx = [] # to test callback
- x = optimize.minimize(self.f1, x0, method='TNC',
- jac=self.g1, bounds=bnds,
- options=self.opts, callback=iterx.append).x
- assert_allclose(self.f1(x), self.f1(xopt), atol=1e-8)
+ res = optimize.minimize(self.f1, x0, method='TNC', jac=self.g1,
+ bounds=bnds, options=self.opts,
+ callback=iterx.append)
+ assert_allclose(res.fun, self.f1(xopt), atol=1e-8)
+ assert_equal(len(iterx), res.nit)
def test_minimize_tnc1b(self):
"""Minimize, method=TNC, 1b (approx gradient)"""
Please sign in to comment.
Something went wrong with that request. Please try again.