Skip to content

Commit

Permalink
Merge pull request #506 from optuna/contramundum53-patch-1
Browse files Browse the repository at this point in the history
Fix check for single-objective study
  • Loading branch information
c-bata authored Jun 22, 2023
2 parents 828cbef + 74f1b7c commit 446b313
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions optuna_dashboard/_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,11 @@ def get_study_detail(study_id: int) -> dict[str, Any]:
trials = get_trials(storage, study_id)

# TODO(c-bata): Cache best_trials
if summary.directions == 1:
best_trials = [storage.get_best_trial(study_id)]
if len(summary.directions) == 1:
if len([t for t in trials if t.state == TrialState.COMPLETE]) == 0:
best_trials = []
else:
best_trials = [storage.get_best_trial(study_id)]
else:
best_trials = get_pareto_front_trials(trials=trials, directions=summary.directions)
(
Expand Down

0 comments on commit 446b313

Please sign in to comment.