22import json
33from pathlib import Path
44
5- from codeclash .analysis .metrics .elo import get_scores
65from pydantic import BaseModel
76
7+ from codeclash .analysis .metrics .elo_broken import get_scores
8+
89
910class FileLock :
1011 def __init__ (self , lock_path : str | Path ):
@@ -32,11 +33,11 @@ class Instance(BaseModel):
3233 @property
3334 def instance_id (self ) -> str :
3435 return f"{ self .tournament_name } __{ self .player_name } __r{ self .round_number } "
35-
36+
3637 @property
3738 def tournament_path (self ) -> Path :
3839 return self .trajectory_path .parent .parent .parent
39-
40+
4041 @property
4142 def metadata_path (self ) -> Path :
4243 return self .tournament_path / "metadata.json"
@@ -46,8 +47,10 @@ def get_lm_name_self_opponent(self) -> tuple[str, str]:
4647 player_configs = metadata ["config" ]["players" ]
4748 player_config = [pc for pc in player_configs if pc ["name" ] == self .player_name ][0 ]
4849 other_player_config = [pc for pc in player_configs if pc ["name" ] != self .player_name ][0 ]
49- return player_config ["config" ]["model" ]["model_name" ].removeprefix ("@" ), other_player_config ["config" ]["model" ]["model_name" ].removeprefix ("@" )
50-
50+ return player_config ["config" ]["model" ]["model_name" ].removeprefix ("@" ), other_player_config ["config" ]["model" ][
51+ "model_name"
52+ ].removeprefix ("@" )
53+
5154 def get_current_next_round_win_rate (self ) -> tuple [float | None , float | None ]:
5255 metadata = json .loads (self .metadata_path .read_text ())
5356 current_round_stats = metadata ["round_stats" ].get (str (self .round_number ))
0 commit comments