diff --git a/cooperative_cuisine/scores.py b/cooperative_cuisine/scores.py index 03c9bfd669a367dc68adf8286aeef61ec608429e..05891b2f4e950f1ceb1895a7ab03712d677feae6 100644 --- a/cooperative_cuisine/scores.py +++ b/cooperative_cuisine/scores.py @@ -120,10 +120,10 @@ def stepped_score( raise ValueError("steps and vals must have the same length") for threshold, ratio in zip(reversed(steps), reversed(score_ratios)): - if time_percentage >= threshold: + if max(time_percentage, 0) >= threshold: return float(np.round(max_score * ratio, decimals=round_decimals)) - assert False, "Should not reach here." + assert False, "This should not happen." class ScoreViaHooks(HookCallbackClass):