Skip to content

Commit

Permalink
fixed small problem with status task filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
FilippoAiraldi committed Dec 3, 2023
1 parent ad0ac32 commit e160207
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions benchmarking/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ def get_status(filename_for_status: str) -> dict[str, dict[int, int]]:
Returns the status of the run, i.e., the number of iterations for each problem
and for each horizon that has already been computed.
"""
with open(filename_for_status) as f:
lines = f.readlines() # better to read all at once

out: dict[str, dict[int, int]] = {}

try:
with open(filename_for_status) as f:
lines = f.readlines() # better to read all at once
except FileNotFoundError:
return out

maxiters = {n: get_benchmark_problem(n)[1] + 1 for n in PROBLEMS}
for line in lines:
elements = line.split(",")
Expand Down

0 comments on commit e160207

Please sign in to comment.