File size: 1,432 Bytes
ccba775
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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()