Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/optimagic/benchmarking/process_benchmark_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ def _process_one_result(
}

# calculate at which iteration the problem has been solved
if stopping_criterion is not None:
if stopping_criterion is None:
is_converged = False
else:
is_converged_x, x_idx = _check_convergence(params_dist_normalized, x_precision)
is_converged_y, y_idx = _check_convergence(normalized_crit_hist, y_precision)

Expand Down
15 changes: 8 additions & 7 deletions tests/optimagic/visualization/test_convergence_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,14 @@ def test_convergence_plot_options(options, grid, benchmark_results, close_mpl_fi
def test_convergence_plot_stopping_criterion_none(benchmark_results):
problems, results = benchmark_results

with pytest.raises(UnboundLocalError):
convergence_plot(
problems=problems,
results=results,
problem_subset=["bard_good_start"],
stopping_criterion=None,
)
fig = convergence_plot(
problems=problems,
results=results,
problem_subset=["bard_good_start"],
stopping_criterion=None,
)

assert fig is not None


def test_check_only_allowed_subset_provided_none():
Expand Down
Loading