projektAI/venv/Lib/site-packages/scipy/optimize/_trustregion_constr/tests/test_report.py

11 lines
408 B
Python
Raw Normal View History

2021-06-06 22:13:05 +02:00
from scipy.optimize import minimize, Bounds
def test_gh10880():
# checks that verbose reporting works with trust-constr
bnds = Bounds(1, 2)
opts = {'maxiter': 1000, 'verbose': 2}
minimize(lambda x: x**2, x0=2., method='trust-constr', bounds=bnds, options=opts)
opts = {'maxiter': 1000, 'verbose': 3}
minimize(lambda x: x**2, x0=2., method='trust-constr', bounds=bnds, options=opts)