Download run_cached_figures.py from ChatterjeeLab/ScooBDoob: direct link, hf CLI and curl.
- Browser
- Download file 1.08 kB
-
https://huggingface.co/ChatterjeeLab/ScooBDoob/resolve/main/run_cached_figures.py
- Command line
-
hf download hf://ChatterjeeLab/ScooBDoob/run_cached_figures.py
-
curl -L -o run_cached_figures.py https://huggingface.co/ChatterjeeLab/ScooBDoob/resolve/main/run_cached_figures.py
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) | |