MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / to_dict

Method to_dict

codeclash/arenas/arena.py:60–69  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

58 rv.extend(["Details:"] + [f"- {line}" for line in self.details])
59 return "\n".join(rv)
60
61 def to_dict(self) -> dict[str, Any]:
62 # Going through some pain to ensure that the scores dict is always complete
63 player_names = set(self.player_stats.keys()) | set(self.scores.keys())
64 return {
65 "round_num": self.round_num,
66 "winner": self.winner,
67 "details": self.details,
68 "scores": {name: self.scores.get(name, 0.0) for name in player_names},
69 "player_stats": {name: stats.to_dict() for name, stats in self.player_stats.items()},
70 }
71
72

Callers 4

mainFunction · 0.45
run_competition_phaseMethod · 0.45
run_training_roundMethod · 0.45

Calls 1

getMethod · 0.80

Tested by

no test coverage detected