Skip to content

Commit b0c5792

Browse files
committed
Find game folders based on metadata.json instead of game.log
1 parent 41de75c commit b0c5792

10 files changed

Lines changed: 12 additions & 12 deletions

codeclash/analysis/metrics/elo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def main(log_dir: Path, k_factor: int, starting_elo: int, weighting_function: st
100100
+ (f" (alpha={alpha})" if weighting_function == "exponential" else "")
101101
)
102102
player_profiles = {}
103-
for game_log_folder in tqdm([x.parent for x in log_dir.rglob("game.log")]):
103+
for game_log_folder in tqdm([x.parent for x in log_dir.rglob("metadata.json")]):
104104
arena = game_log_folder.name.split(".")[1]
105105
with open(game_log_folder / "metadata.json") as f:
106106
metadata = json.load(f)

codeclash/analysis/metrics/win_rate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def main(log_dir: Path):
2929
# - game.log
3030
# - metadata.json
3131
model_profiles = {}
32-
for game_log_folder in tqdm([x.parent for x in log_dir.rglob("game.log")]):
32+
for game_log_folder in tqdm([x.parent for x in log_dir.rglob("metadata.json")]):
3333
game_id = game_log_folder.name.split(".")[1]
3434
player_ids = [x.name for x in (game_log_folder / "players").iterdir() if x.is_dir()]
3535
metadata = json.load(open(game_log_folder / "metadata.json"))

codeclash/analysis/stats/per_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def failure_stats(self) -> dict:
102102

103103
def main(log_dir: str):
104104
profiles = {}
105-
tournaments = [x.parent for x in log_dir.rglob("game.log")]
105+
tournaments = [x.parent for x in log_dir.rglob("metadata.json")]
106106
for game_log_folder in tqdm(tournaments):
107107
with open(game_log_folder / "metadata.json") as f:
108108
metadata = json.load(f)

codeclash/analysis/viz/cdf_command_diversity.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ def main():
123123
"""
124124
model_to_diversity = {}
125125

126-
# Find all tournament directories by looking for game.log files
127-
tournaments = [x.parent for x in LOCAL_LOG_DIR.rglob("game.log")]
126+
# Find all tournament directories by looking for metadata.json files
127+
tournaments = [x.parent for x in LOCAL_LOG_DIR.rglob("metadata.json")]
128128
for game_log_folder in tqdm(tournaments):
129129
# Load tournament metadata to get player-to-model mapping
130130
with open(game_log_folder / "metadata.json") as f:

codeclash/analysis/viz/cdf_files_edited_per_round.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
def main():
1313
model_to_num_files = {}
1414

15-
tournaments = [x.parent for x in LOCAL_LOG_DIR.rglob("game.log")]
15+
tournaments = [x.parent for x in LOCAL_LOG_DIR.rglob("metadata.json")]
1616
for game_log_folder in tqdm(tournaments):
1717
with open(game_log_folder / "metadata.json") as f:
1818
metadata = json.load(f)

codeclash/analysis/viz/cdf_steps_per_round.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
def main():
1313
model_to_steps = {}
1414

15-
tournaments = [x.parent for x in LOCAL_LOG_DIR.rglob("game.log")]
15+
tournaments = [x.parent for x in LOCAL_LOG_DIR.rglob("metadata.json")]
1616
for game_log_folder in tqdm(tournaments):
1717
with open(game_log_folder / "metadata.json") as f:
1818
metadata = json.load(f)

codeclash/analysis/viz/cdf_thought_length_per_round.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
def main():
1414
model_to_steps = {}
1515

16-
tournaments = [x.parent for x in LOCAL_LOG_DIR.rglob("game.log")]
16+
tournaments = [x.parent for x in LOCAL_LOG_DIR.rglob("metadata.json")]
1717
for game_log_folder in tqdm(tournaments):
1818
with open(game_log_folder / "metadata.json") as f:
1919
metadata = json.load(f)

codeclash/analysis/viz/line_chart_per_round_elo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def main(log_dir: Path, k_factor: int, starting_elo: int, weighting_function: st
3232
+ (f" (alpha={alpha})" if weighting_function == "exponential" else "")
3333
)
3434
player_round_profiles = {}
35-
for game_log_folder in tqdm([x.parent for x in log_dir.rglob("game.log")]):
35+
for game_log_folder in tqdm([x.parent for x in log_dir.rglob("metadata.json")]):
3636
arena = game_log_folder.name.split(".")[1]
3737
metadata = json.load(open(game_log_folder / "metadata.json"))
3838
try:

codeclash/analysis/viz/line_chart_per_round_win_rate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def main(log_dir: Path):
2828

2929
player_round_profiles = {}
3030

31-
for game_log_folder in tqdm([x.parent for x in log_dir.rglob("game.log")]):
31+
for game_log_folder in tqdm([x.parent for x in log_dir.rglob("metadata.json")]):
3232
arena = game_log_folder.name.split(".")[1]
3333
metadata = json.load(open(game_log_folder / "metadata.json"))
3434

codeclash/analysis/viz/survival_curve_error_recovery.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ def main():
171171
"""
172172
model_to_recovery_times = defaultdict(list)
173173

174-
# Find all tournament directories by looking for game.log files
175-
tournaments = [x.parent for x in LOCAL_LOG_DIR.rglob("game.log")]
174+
# Find all tournament directories by looking for metadata.json files
175+
tournaments = [x.parent for x in LOCAL_LOG_DIR.rglob("metadata.json")]
176176
for game_log_folder in tqdm(tournaments):
177177
# Load tournament metadata to get player-to-model mapping
178178
with open(game_log_folder / "metadata.json") as f:

0 commit comments

Comments
 (0)