(files: List[Path])
| 22 | |
| 23 | |
| 24 | def load_runs(files: List[Path]) -> List[Dict]: |
| 25 | runs = [] |
| 26 | for path in files: |
| 27 | with path.open() as fh: |
| 28 | data = json.load(fh) |
| 29 | for idx, run in enumerate(data["runs"]): |
| 30 | runs.append( |
| 31 | { |
| 32 | "file": path.name, |
| 33 | "run_index_in_file": idx, |
| 34 | "agent": run["model"], |
| 35 | "finalScore": run["summary"]["finalScore"], |
| 36 | "scores": { |
| 37 | score["assignment"]["name"]: score["averageScore"] |
| 38 | for score in run["scores"] |
| 39 | }, |
| 40 | } |
| 41 | ) |
| 42 | return runs |
| 43 | |
| 44 | |
| 45 | def melt_scores(runs: List[Dict]) -> pd.DataFrame: |