diff --git a/benchmarks/imaging_shower_ML/config.yml b/benchmarks/imaging_shower_ML/config.yml index bb410998321e57b91b6a575e6ff26f06a33644c4..9b4c829cfaa0d99407bd9d2438ef898264edbd85 100644 --- a/benchmarks/imaging_shower_ML/config.yml +++ b/benchmarks/imaging_shower_ML/config.yml @@ -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 diff --git a/benchmarks/imaging_shower_ML/run_benchmark.py b/benchmarks/imaging_shower_ML/run_benchmark.py index 0620e040e9bfe9d199e1ac352666626c73a6abef..bc91124a8af24c3b91beb7fb198ed767a460df80 100755 --- a/benchmarks/imaging_shower_ML/run_benchmark.py +++ b/benchmarks/imaging_shower_ML/run_benchmark.py @@ -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)) +