"""Rerun the nineteen shorter checks and write their outputs beside this file.""" from pathlib import Path import subprocess import sys ROOT = Path(__file__).resolve().parent # Arguments, output filename, and whether the original runner captured stderr. CHECKS = [ (['check2.py'], 'check2.log', True), (['diff.py'], 'diff.log', True), (['look.py'], 'look.log', True), (['logexp.py', 'walsh.log', 'q3.log', 'q5.log', 'q1000003.log'], 'logexp.log', True), (['s2check.py'], 's2check.log', True), (['s2s3fit.py'], 's2s3fit.log', True), (['villaincheck.py'], 'villaincheck.log', True), (['crossover.py'], 'crossover.csv', False), (['hankel.py'], 'hankel.log', False), (['twelfth.py'], 'twelfth.log', False), (['graphcheck.py'], 'graphcheck.log', False), (['order16.py'], 'order16.log', False), (['walshedge.py'], 'walshedge.log', False), (['fluxes.py'], 'fluxes.log', False), (['freeenergy.py'], 'freeenergy.log', False), (['chu.py'], 'chu.log', False), (['sixth.py'], 'sixth.log', True), (['invariants6.py'], 'invariants6.log', False), (['hypercube.py'], 'hypercube.log', False), ] def main(): for args, filename, capture_stderr in CHECKS: print("Running", args[0], flush=True) with (ROOT / filename).open("w") as output: subprocess.run( [sys.executable, *args], cwd=ROOT, stdout=output, stderr=subprocess.STDOUT if capture_stderr else None, check=True, ) if __name__ == "__main__": main()