Skip to content

Commit 30bd73c

Browse files
committed
Add more naming
1 parent 0b7d618 commit 30bd73c

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

  • codeclash/analysis/code_evolve

codeclash/analysis/code_evolve/main.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from tqdm.auto import tqdm
1515
from unidiff import PatchSet
1616

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
1818
from codeclash.constants import LOCAL_LOG_DIR
1919
from codeclash.games import ARENAS
2020

@@ -302,9 +302,6 @@ def plot_opponent_effect_heatmap(data_cache: str, target_round: int, output_path
302302
Plot heatmap showing how model consistency varies by opponent.
303303
Answers questions 2a (round 1) and 2b (round 15).
304304
"""
305-
if output_path is None:
306-
output_path = f"assets/heatmap_code_evolution_per_opponent_r{target_round}.png"
307-
308305
results = load_cached_results(data_cache)
309306
models, opponent_matrix = compute_opponent_effect_matrix(results, target_round)
310307

@@ -391,7 +388,7 @@ def plot_opponent_effect_heatmap(data_cache: str, target_round: int, output_path
391388
print(f"Saved heatmap to {output_path}")
392389

393390

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):
395392
"""
396393
Plot line graph: x-axis = round, y-axis = code similarity, one line per model.
397394
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
448445
)
449446

450447
# 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
452450

453451
# 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

Comments
 (0)