Spaces:
Runtime error
Runtime error
Download Strange/run_all.py from Two-Quarks/QuarksLab: direct link, hf CLI and curl.
- Browser
- Download file 1.43 kB
-
https://huggingface.co/spaces/Two-Quarks/QuarksLab/resolve/main/Strange/run_all.py
- Command line
-
hf download hf://spaces/Two-Quarks/QuarksLab/Strange/run_all.py
-
curl -L -o run_all.py https://huggingface.co/spaces/Two-Quarks/QuarksLab/resolve/main/Strange/run_all.py
1.43 kB
| import os | |
| import sys | |
| import subprocess | |
| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parent | |
| STRANGE_DIR = ROOT / "strange" | |
| ANTISTRANGE_DIR = ROOT / "AntiStrange" | |
| OUT_GRAPHICS = ROOT / "graphics" | |
| def _run(cmd, cwd: Path): | |
| print(f"[run] ({cwd}) $ {' '.join(cmd)}") | |
| subprocess.run(cmd, cwd=str(cwd), check=True) | |
| def main(): | |
| py = sys.executable | |
| OUT_GRAPHICS.mkdir(parents=True, exist_ok=True) | |
| # 1) Run Strange | |
| _run([py, str(STRANGE_DIR / "exp" / "run_strange_hypothesis_lab.py")], cwd=STRANGE_DIR) | |
| # 2) Plot Strange -> ROOT/graphics | |
| _run([py, str(STRANGE_DIR / "exp" / "plot_results.py"), | |
| "--csv", str(STRANGE_DIR / "results" / "strange_hypothesis_lab.csv"), | |
| "--out", str(OUT_GRAPHICS), | |
| "--prefix", "Strange"], cwd=STRANGE_DIR) | |
| # 3) Run AntiStrange | |
| _run([py, str(ANTISTRANGE_DIR / "exp" / "run_antistrange_hypothesis_lab.py")], cwd=ANTISTRANGE_DIR) | |
| # 4) Plot AntiStrange -> ROOT/graphics | |
| _run([py, str(ANTISTRANGE_DIR / "exp" / "plot_results.py"), | |
| "--csv", str(ANTISTRANGE_DIR / "results" / "antistrange_hypothesis_lab.csv"), | |
| "--out", str(OUT_GRAPHICS), | |
| "--prefix", "AntiStrange"], cwd=ANTISTRANGE_DIR) | |
| # 5) Dual plot (both on same figure) | |
| _run([py, str(ROOT / "plot_dual_results.py")], cwd=ROOT) | |
| print(f"[ok] Finished. All plots saved to: {OUT_GRAPHICS}") | |
| if __name__ == "__main__": | |
| main() | |