make_all_figures.py — src/21-gravity

The script src/21-gravity/make_all_figures.py of the validation package of the paper 21-grav, rendered with an anchor per line. ▶ run the predicates on Google Colab.

21-gravity ledgersrc/21-gravity/make_all_figures.py · 0.8 KBmake_all_figures.pyColab
1"""Regenerate every figure produced for this paper, into ../figures/.23Runs each make_fig_*.py script. (Figure 1 and Figure 2 panels b,c are external assets4not regenerated here; make_fig_phase_a.py regenerates Figure 2 panel (a) with g=5.)5"""6import subprocess, sys, pathlib7here = pathlib.Path(__file__).resolve().parent8scripts = ["make_fig_sync.py", "make_fig_anatomy.py", "make_fig_shadow.py",9           "make_fig_rar.py", "make_fig_phase_a.py"]10ok = True11for s in scripts:12    print(f"=== {s} ===")13    p = subprocess.run([sys.executable, str(here/s)], capture_output=True, text=True)14    print(p.stdout, end="")15    if p.returncode != 0:16        ok = False17        print(p.stderr, file=sys.stderr)18print("\nALL FIGURES REGENERATED" if ok else "\nSOME FIGURES FAILED")19sys.exit(0 if ok else 1)20