Skip to content

Commit 7560acf

Browse files
committed
feat: change stats runs from int to list of str
1 parent 3e8a655 commit 7560acf

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/balatrollm/benchmark.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ModelAggregatedStats:
3131

3232
@dataclass
3333
class ModelStats:
34-
runs: int
34+
runs: list[str]
3535
wins: int
3636
completed: int
3737

@@ -104,6 +104,7 @@ def analyze_strategy_runs(self, strategy_dir: Path) -> None:
104104
def compute_model_stats(self, model_dir: Path) -> ModelStatsFull:
105105
stats: list[Stats] = []
106106
configs: list[Config] = []
107+
run_names: list[str] = []
107108
for run_dir in model_dir.iterdir():
108109
if not run_dir.is_dir():
109110
continue
@@ -119,6 +120,7 @@ def compute_model_stats(self, model_dir: Path) -> ModelStatsFull:
119120
stats.append(Stats.from_dict(json.load(f)))
120121
with open(config_file, "r") as f:
121122
configs.append(Config(**json.load(f)))
123+
run_names.append(run_dir.name)
122124

123125
config = configs[0]
124126
for c in configs[1:]:
@@ -188,7 +190,7 @@ def tot_std_dev(attr: str) -> float:
188190
)
189191

190192
return ModelStatsFull(
191-
runs=len(stats),
193+
runs=run_names,
192194
wins=len([s for s in stats if s.won]),
193195
completed=len([s for s in stats if s.completed]),
194196
avg_final_round=avg_final_round,
@@ -327,7 +329,3 @@ def create_detailed_run_dirs(self, model_dir: Path, output_dir: Path) -> None:
327329
if png_file.exists():
328330
screenshot_dest = custom_id_dir / "screenshot.png"
329331
screenshot_dest.write_bytes(png_file.read_bytes())
330-
331-
# Convert all PNG files to AVIF after processing the run
332-
if detailed_run_dir.exists():
333-
self.convert_pngs_to_avif(detailed_run_dir)

0 commit comments

Comments
 (0)