Skip to content
Snippets Groups Projects
Commit 1516a7c6 authored by Chao Peng's avatar Chao Peng
Browse files

add a top-level run information output

parent 63caa096
Branches
No related tags found
1 merge request!287Add plot script for e/pi separation performance
This commit is part of merge request !287. Comments created here will be created in the context of that merge request.
......@@ -8,6 +8,6 @@ ml_shower:epi_separation:
if [[ ${DETECTOR} =~ athena
|| ${DETECTOR} =~ ecce && ${DETECTOR_CONFIG} =~ imaging ]] ; then
pip3 install -r benchmarks/imaging_shower_ML/requirements.txt
python3 benchmarks/imaging_shower_ML/run_benchmark.py -t imcal_epi -n 1000 --pmin 1.8 --pmax 2.2 --nocut-samples
python3 benchmarks/imaging_shower_ML/run_benchmark.py -t imcal_epi -n 1000 --p-min 1.8 --p-max 2.2
fi
......@@ -12,6 +12,7 @@
'''
import os
import sys
import json
import subprocess
import argparse
......@@ -268,3 +269,16 @@ if __name__ == '__main__':
# TODO: collect the two-step results (e/p cut and ML)
# save run information
# NOTE: runs with the same outdir will be combined (overwrite if nametag is the same)
run_data = {args.ntag: kwargs}
try:
with open(os.path.join(args.outdir, 'result.json'), 'r') as f:
run_data = json.load(f)
run_data.update({args.ntag: kwargs})
except (FileNotFoundError, json.decoder.JSONDecodeError):
pass
with open(os.path.join(args.outdir, 'result.json'), 'w') as f:
f.write(json.dumps(run_data, sort_keys=True, indent=4))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment