Skip to content
Open
Changes from all commits
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
5 changes: 3 additions & 2 deletions dreadnode/optimization/stop.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ def score_value(
"""

def stop(trials: list[Trial]) -> bool: # noqa: PLR0911
if not trials:
finished_trials = [t for t in trials if t.status == "finished"]
if not finished_trials:
return False

trial = trials[-1]
trial = finished_trials[-1]
value_to_check = trial.scores.get(metric_name) if metric_name else trial.score
if value_to_check is None:
return False
Expand Down
Loading