Skip to content

Commit

Permalink
catch EOFError while loading anomalies
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schrade committed Dec 12, 2024
1 parent b5afdbf commit 37de31e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions algo/curve_anomaly/curve_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ def load_data(filename_dict, data_list, anomalies):
print("Data buffer could not be loaded! This might be caused by not having any data in the buffer yet.")

if os.path.exists(anomalies_path):
with open(anomalies_path, 'rb') as f:
anomalies = pickle.load(f)
try:
with open(anomalies_path, 'rb') as f:
anomalies = pickle.load(f)
except EOFError:
print("Could not load the historic anomalies!")


return data_list, anomalies

0 comments on commit 37de31e

Please sign in to comment.