Skip to content

Commit

Permalink
Add test case for history plot
Browse files Browse the repository at this point in the history
  • Loading branch information
timmens committed Nov 13, 2024
1 parent f1276f2 commit 63a4e93
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/optimagic/visualization/test_history_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,10 @@ def test_harmonize_inputs_to_dict_list_results():

def test_harmonize_inputs_to_dict_dict_input():
res = minimize(fun=lambda x: x @ x, params=np.arange(5), algorithm="scipy_lbfgsb")
results = {"bla": res, "blub": res}
assert _harmonize_inputs_to_dict(results=results, names=None) == results
results = {"bla": res, om.algos.scipy_lbfgsb(): res, om.algos.scipy_neldermead: res}
got = _harmonize_inputs_to_dict(results=results, names=None)
expected = {"bla": res, "scipy_lbfgsb": res, "scipy_neldermead": res}
assert got == expected


def test_harmonize_inputs_to_dict_dict_input_with_names():
Expand Down

0 comments on commit 63a4e93

Please sign in to comment.