Skip to content

Commit

Permalink
Fix dictionary, add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
adjeiv committed Aug 3, 2023
1 parent ad6e96c commit ac7bf18
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion optuna/visualization/_intermediate_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def _get_intermediate_plot(info: _IntermediatePlotInfo) -> "go.Figure":
mode="lines+markers",
marker=default_marker
if tinfo.feasible
else default_marker.update({"color": "#CCCCCC"}), # type: ignore[dict-item]
else {**default_marker, "color": "#CCCCCC"},
name="Trial{}".format(tinfo.trial_number),
)
for tinfo in trial_infos
Expand Down
10 changes: 10 additions & 0 deletions tests/visualization_tests/test_intermediate_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ def constraints(trial: FrozenTrial) -> Sequence[float]:
)
]
),
_IntermediatePlotInfo(
trial_infos=[
_TrialInfo(
trial_number=0, sorted_intermediate_values=[(0, 1.0), (1, 2.0)], feasible=True
),
_TrialInfo(
trial_number=1, sorted_intermediate_values=[(1, 2.0), (0, 1.0)], feasible=False
)
]
),
],
)
def test_plot_intermediate_values(
Expand Down

0 comments on commit ac7bf18

Please sign in to comment.