Skip to content

Commit 7987d05

Browse files
committed
do not break with empty results file
1 parent dccfd33 commit 7987d05

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

generate_plot.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import matplotlib.pyplot as plt
55
from datetime import datetime
66
import os
7-
7+
import sys
88
base_dir = "results"
99
records = []
1010

@@ -24,6 +24,11 @@ def extract_timestamp(folder_name):
2424

2525
# Get and sort folders by timestamp
2626
folders = [f for f in os.listdir(base_dir) if os.path.isdir(os.path.join(base_dir, f))]
27+
28+
if not folders:
29+
print("No result folders found in the 'results' directory.")
30+
sys.exit(0)
31+
2732
folders.sort(key=extract_timestamp)
2833

2934
# Process folders in sorted order

0 commit comments

Comments
 (0)