You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
___________________ test_correct_startpoint_usage[34-nlopt] ____________________
optimizer = ('nlopt', 11)
def test_correct_startpoint_usage(optimizer):
"""
Test that the startpoint is correctly used in all optimizers.
"""
# cma supports x0, but samples from this initial guess, therefore return
if optimizer == ("cma", ""):
return
opt = get_optimizer(*optimizer)
# return if the optimizer knowingly does not support x_guesses
if not opt.check_x0_support():
return
# define a problem with an x_guess
problem = CRProblem(x_guesses=[np.array([0.1, 0.1])]).get_problem()
# run optimization
result = optimize.minimize(
problem=problem,
optimizer=opt,
n_starts=1,
progress_bar=False,
history_options=pypesto.HistoryOptions(trace_record=True),
)
# check that the startpoint was used
> assert problem.x_guesses[0] == pytest.approx(
result.optimize_result[0].history.get_x_trace(0)
)
E assert array([0.1, 0.1]) == approx([0.317...27 ± 3.2e-07])
E
E comparison failed. Mismatched elements: 2 / 2:
E Max absolute difference: 0.2170485381304927
E Max relative difference: 2.170485381304927
E Index | Obtained | Expected
E (0,) | 0.1 | 0.3170485381304927 ± 3.2e-07
E (1,) | 0.1 | 0.3170485381304927 ± 3.2e-07
test/optimize/test_optimize.py:668: AssertionError
The text was updated successfully, but these errors were encountered:
e.g. https://github.com/ICB-DCM/pyPESTO/actions/runs/11889668047/job/33126701722?pr=1508
Probably related to the recent nlopt release
The text was updated successfully, but these errors were encountered: