Download experiments/build_figures.py from fahadhafeezofficial/clsa-code: direct link, hf CLI and curl.
- Browser
- Download file 1.08 kB
-
https://huggingface.co/datasets/fahadhafeezofficial/clsa-code/resolve/main/experiments/build_figures.py
- Command line
-
hf download hf://datasets/fahadhafeezofficial/clsa-code/experiments/build_figures.py
-
curl -L -o build_figures.py https://huggingface.co/datasets/fahadhafeezofficial/clsa-code/resolve/main/experiments/build_figures.py
1.08 kB
| # Copyright (c) 2026 CLSA contributors | |
| # SPDX-License-Identifier: MIT | |
| """Regenerate every figure from results/. A missing result skips its figure.""" | |
| from __future__ import annotations | |
| import subprocess | |
| import sys | |
| from pathlib import Path | |
| FIGURES = Path(__file__).resolve().parents[1] / "figures" | |
| SCRIPTS = sorted(FIGURES.glob("f*.py")) | |
| def main() -> None: | |
| failed = [] | |
| for script in SCRIPTS: | |
| out = subprocess.run( | |
| [sys.executable, script.name], cwd=str(FIGURES), capture_output=True, text=True | |
| ) | |
| status = "ok" if out.returncode == 0 else "skipped/failed" | |
| print(f"[{status}] {script.name}") | |
| if out.returncode != 0: | |
| failed.append((script.name, (out.stderr or "").strip().splitlines()[-1:])) | |
| if failed: | |
| print("\nFigures not produced (with reason):") | |
| for name, err in failed: | |
| print(f" {name}: {err}") | |
| tables = FIGURES / "tables.py" | |
| if tables.exists(): | |
| subprocess.run([sys.executable, "tables.py"], cwd=str(FIGURES)) | |
| if __name__ == "__main__": | |
| main() | |