Download scripts/run_benchmarks.py from tmepass000/matter-os: direct link, hf CLI and curl.
- Browser
- Download file 879 Bytes
-
https://huggingface.co/tmepass000/matter-os/resolve/main/scripts/run_benchmarks.py
- Command line
-
hf download hf://tmepass000/matter-os/scripts/run_benchmarks.py
-
curl -L -o run_benchmarks.py https://huggingface.co/tmepass000/matter-os/resolve/main/scripts/run_benchmarks.py
879 Bytes
| """Reproduce all registered trusted benchmarks (configs/solver_registry.yaml) and write docs/benchmarks/solver_benchmarks.json.""" | |
| import json | |
| import sys | |
| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parent.parent | |
| sys.path.insert(0, str(ROOT)) | |
| from matter_os.app import MatterOS # noqa: E402 | |
| from simulation.benchmarks import run_all # noqa: E402 | |
| if __name__ == "__main__": | |
| app = MatterOS() | |
| res = run_all(app, app.create_project("benchmarks").project_id) | |
| out = ROOT / "docs" / "benchmarks"; out.mkdir(parents=True, exist_ok=True) | |
| (out / "solver_benchmarks.json").write_text(json.dumps(res, indent=1, default=str)) | |
| for r in res: | |
| print(f"{r['benchmark']:28s} computed={r.get('computed')} {r.get('unit')} ref={r.get('reference', {}).get('value')} " | |
| f"dev={r.get('deviation')} -> {'PASS' if r.get('passed') else 'FAIL'}") | |