-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathplot_cmcs.py
24 lines (20 loc) · 969 Bytes
/
plot_cmcs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import argparse
import glob
import os
from benchmark_tools.plot import plot_cmcs
from benchmark_tools.stats import load_stats, compute_stats
def main(args):
source_files = sorted(glob.glob(os.path.join(args.stats_folder, '*.json')))
all_stats = [load_stats(file) for file in source_files]
captures = [item['capture'] for item in all_stats]
iters = [item['calc_counters'][-1] for item in all_stats]
cmcs = [[item['cmc_iters'], item['cmc_vals']] for item in all_stats]
print(zip(captures, iters))
plot_cmcs(cmcs, captures=captures, show=args.show, log=True,
filename=args.output if len(args.output) > 0 else os.path.join(args.stats_folder, 'cmc.pdf'))
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='')
parser.add_argument('stats_folder', type=str)
parser.add_argument('--show', action='store_true')
parser.add_argument('--output', type=str, default='')
main(parser.parse_args())