From 4b1358a06d53a0899cda8ec670400bf906cc44ab Mon Sep 17 00:00:00 2001 From: "Rodrigo V. Honorato" Date: Fri, 17 Jul 2026 10:34:12 +0200 Subject: [PATCH 1/2] update haddock-runner version --- versions.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions.env b/versions.env index af10b5f..c107422 100644 --- a/versions.env +++ b/versions.env @@ -9,7 +9,7 @@ HADDOCK3_VERSION=2026.7.0 # which haddock-runner to be used - github release tag -HADDOCK_RUNNER_TAG=v3.2.1 +HADDOCK_RUNNER_TAG=v4.0.0 # which commits of the benchmarks repositories to use From 35bb63920884a7bd1256526703718db25f6cc531 Mon Sep 17 00:00:00 2001 From: "Rodrigo V. Honorato" Date: Fri, 17 Jul 2026 10:34:30 +0200 Subject: [PATCH 2/2] add `summary_to_csv.py` --- scripts/summary_to_csv.py | 85 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 scripts/summary_to_csv.py diff --git a/scripts/summary_to_csv.py b/scripts/summary_to_csv.py new file mode 100644 index 0000000..8feb1c8 --- /dev/null +++ b/scripts/summary_to_csv.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python3 +"""Convert a haddock-runner `summary.json` file into two flat CSVs.""" + +import argparse +import csv +import json +from pathlib import Path + + +def build_rows(data: dict): + """Flatten a summary.json dict into (scenario_rows, job_rows).""" + scenario_rows = [] + for scenario in data.get("scenarios", []): + scenario_rows.append( + { + "scenario_name": scenario["name"], + "scenario_total": scenario["total"], + "scenario_completed": scenario["completed"], + "scenario_skipped": scenario["skipped"], + "scenario_failed": scenario["failed"], + "scenario_duration_secs": scenario["duration_secs"], + } + ) + + job_rows = [] + for job in data.get("jobs", []): + job_rows.append( + { + "job_name": job["name"], + "scenario": job["scenario"], + "target": job["target"], + "status": job["status"], + "duration_secs": job["duration_secs"], + } + ) + + return scenario_rows, job_rows + + +def write_csv(path: Path, rows: list) -> None: + """Write rows (list of dicts) to path as CSV, or an empty file if none.""" + if not rows: + path.write_text("") + return + with path.open("w", newline="") as f: + writer = csv.DictWriter(f, fieldnames=list(rows[0].keys())) + writer.writeheader() + writer.writerows(rows) + + +def main(): + """Parse CLI args, convert the given summary.json, and write the two CSVs.""" + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("summary_json", type=Path, help="Path to a summary.json file") + parser.add_argument( + "suffix", + help="Suffix appended to output filenames, e.g. 'sha' -> scenarios_sha.csv", + ) + parser.add_argument( + "-o", + "--output-dir", + type=Path, + default=Path.cwd(), + help="Directory to write the CSVs into (default: cwd)", + ) + args = parser.parse_args() + + data = json.loads(args.summary_json.read_text()) + scenario_rows, job_rows = build_rows(data) + + args.output_dir.mkdir(parents=True, exist_ok=True) + scenarios_path = args.output_dir / f"scenarios_{args.suffix}.csv" + jobs_path = args.output_dir / f"jobs_{args.suffix}.csv" + + write_csv(scenarios_path, scenario_rows) + write_csv(jobs_path, job_rows) + + print( + f"Wrote {len(scenario_rows)} scenario rows to {scenarios_path}\n" + f"Wrote {len(job_rows)} job rows to {jobs_path}" + ) + + +if __name__ == "__main__": + main()