Skip to content

Commit

Permalink
Update processing of nag result objects.
Browse files Browse the repository at this point in the history
  • Loading branch information
janosg committed Sep 17, 2024
1 parent 4df7f8e commit c7b26fe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/optimagic/optimizers/nag_optimizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,8 +876,13 @@ def _process_nag_result(nag_result_obj, len_x):
results (dict): See :ref:`internal_optimizer_output` for details.
"""
if hasattr(nag_result_obj, "f"):
solution_fun = nag_result_obj.f
else:
solution_fun = nag_result_obj.obj

processed = {
"solution_criterion": nag_result_obj.f,
"solution_criterion": solution_fun,
"n_fun_evals": nag_result_obj.nx,
"message": nag_result_obj.msg,
"success": nag_result_obj.flag == nag_result_obj.EXIT_SUCCESS,
Expand Down

0 comments on commit c7b26fe

Please sign in to comment.