()
| 133 | |
| 134 | |
| 135 | def main() -> None: |
| 136 | # ensure this script can be run from anywhere |
| 137 | parser = argparse.ArgumentParser( |
| 138 | description="Visualize benchmark score instability across runs." |
| 139 | ) |
| 140 | parser.add_argument( |
| 141 | "files", |
| 142 | nargs="+", |
| 143 | type=Path, |
| 144 | help="benchmark JSON files (e.g. benchmarks-0.json benchmarks-1.json …)", |
| 145 | ) |
| 146 | parser.add_argument( |
| 147 | "--output", |
| 148 | type=Path, |
| 149 | default=Path("benchmark_instability.png"), |
| 150 | help="output image path", |
| 151 | ) |
| 152 | args = parser.parse_args() |
| 153 | |
| 154 | runs = load_runs(args.files) |
| 155 | df = melt_scores(runs) |
| 156 | if df.empty: |
| 157 | raise SystemExit("No runs found in the provided files.") |
| 158 | plot_instability(df, args.output) |
| 159 | |
| 160 | |
| 161 | if __name__ == "__main__": |
no test coverage detected