import json import os import pandas as pd from src.display.utils import AutoEvalColumn from src.leaderboard.read_evals import get_raw_eval_results def get_leaderboard_df(requests_path: str, total_issues: int) -> pd.DataFrame: """Creates a dataframe from all the individual experiment results""" raw_data = get_raw_eval_results(requests_path) all_data_json = [v.to_dict(total_issues) for v in raw_data] df = pd.DataFrame.from_records(all_data_json) df = df.sort_values(by=[AutoEvalColumn.full_pass_count.name], ascending=False) return df