ScooBDoob / run_cached_figures.py
ynuozhang
Upload ScooBDoob code without binary caches
31d1d63
Raw History Blame Contribute Delete
1.08 kB
import argparse
import os
from pathlib import Path
import subprocess
import sys
ROOT = Path(__file__).resolve().parent
ap = argparse.ArgumentParser(description="Plot the saved paper results")
ap.add_argument(
"--only", choices=["all", "mb", "aib9_robustness", "p53"], default="all"
)
args = ap.parse_args()
commands = {
"mb": [
["make_mb_panels.py", "--from-cache"],
["make_mb_unconditional.py", "--from-cache"],
],
"aib9_robustness": [["replot_aib9_robustness.py"]],
"p53": [
["paper_figures/plot/p53_discovery_plot.py"],
["paper_figures/plot/p53_preference_plot.py"],
],
}
env = os.environ.copy()
for name in ["OMP_NUM_THREADS", "OPENBLAS_NUM_THREADS", "MKL_NUM_THREADS"]:
env[name] = "1"
env["MPLBACKEND"] = "Agg"
env["MPLCONFIGDIR"] = str(ROOT / ".mplconfig")
for group, jobs in commands.items():
if args.only not in ["all", group]:
continue
for command in jobs:
print("Running:", " ".join(command), flush=True)
subprocess.run([sys.executable, *command], cwd=ROOT, env=env, check=True)