|
14 | 14 | from tqdm.auto import tqdm |
15 | 15 | from unidiff import PatchSet |
16 | 16 |
|
17 | | -from codeclash.analysis.viz.utils import FONT_BOLD, MARKERS, MODEL_TO_COLOR, MODEL_TO_DISPLAY_NAME |
| 17 | +from codeclash.analysis.viz.utils import ASSETS_DIR, FONT_BOLD, MARKERS, MODEL_TO_COLOR, MODEL_TO_DISPLAY_NAME |
18 | 18 | from codeclash.constants import LOCAL_LOG_DIR |
19 | 19 | from codeclash.games import ARENAS |
20 | 20 |
|
@@ -302,9 +302,6 @@ def plot_opponent_effect_heatmap(data_cache: str, target_round: int, output_path |
302 | 302 | Plot heatmap showing how model consistency varies by opponent. |
303 | 303 | Answers questions 2a (round 1) and 2b (round 15). |
304 | 304 | """ |
305 | | - if output_path is None: |
306 | | - output_path = f"assets/heatmap_code_evolution_per_opponent_r{target_round}.png" |
307 | | - |
308 | 305 | results = load_cached_results(data_cache) |
309 | 306 | models, opponent_matrix = compute_opponent_effect_matrix(results, target_round) |
310 | 307 |
|
@@ -391,7 +388,7 @@ def plot_opponent_effect_heatmap(data_cache: str, target_round: int, output_path |
391 | 388 | print(f"Saved heatmap to {output_path}") |
392 | 389 |
|
393 | 390 |
|
394 | | -def plot_consistency_over_rounds(data_cache: str, output_path: str = "assets/line_chart_code_evolution.png"): |
| 391 | +def plot_consistency_over_rounds(data_cache: str, output_path: str): |
395 | 392 | """ |
396 | 393 | Plot line graph: x-axis = round, y-axis = code similarity, one line per model. |
397 | 394 | Answers questions 1a (early round consistency) and 1b (evolution over time). |
@@ -448,8 +445,11 @@ def plot_consistency_over_rounds(data_cache: str, output_path: str = "assets/lin |
448 | 445 | ) |
449 | 446 |
|
450 | 447 | # Questions 1a/1b: Consistency over rounds |
451 | | - plot_consistency_over_rounds(data_cache) # Questions 1a and 1b |
| 448 | + output_path = ASSETS_DIR / f"line_chart_code_evolution_{args.arena}.png" |
| 449 | + plot_consistency_over_rounds(data_cache, output_path=output_path) # Questions 1a and 1b |
452 | 450 |
|
453 | 451 | # Questions 2a/2b: Opponent effect |
454 | | - plot_opponent_effect_heatmap(data_cache, target_round=1) # Question 2a |
455 | | - plot_opponent_effect_heatmap(data_cache, target_round=15) # Question 2b |
| 452 | + output_path = ASSETS_DIR / f"heatmap_code_evolution_per_opponent_r1_{args.arena}.png" |
| 453 | + plot_opponent_effect_heatmap(data_cache, target_round=1, output_path=output_path) # Question 2a |
| 454 | + output_path = ASSETS_DIR / f"heatmap_code_evolution_per_opponent_r15_{args.arena}.png" |
| 455 | + plot_opponent_effect_heatmap(data_cache, target_round=15, output_path=output_path) # Question 2b |
0 commit comments