Skip to content

Commit

Permalink
fix median on empty list
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Oct 20, 2024
1 parent f9ad5d8 commit 1a57de5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions runner/eval_thresholds.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ def pass_time(tensorboard_logfile: PurePath) -> float:
if not valid(logfile):
log.warning("rm %s", logfile)
# logfile.unlink()
t = np.median([
pass_time(logfile) for logfile in dataset.glob("events.out.tfevents.*") if valid(logfile)])
times = [
pass_time(logfile) for logfile in dataset.glob("events.out.tfevents.*") if valid(logfile)]
t = np.median(times) if times else np.inf
timings[dataset.name].append((t, f"{team.name}/{algo.name}"))

# insert `time=np.inf` for each team's missing algos
Expand Down

0 comments on commit 1a57de5

Please sign in to comment.