-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdb_plotting.py
More file actions
25 lines (19 loc) · 752 Bytes
/
Copy pathdb_plotting.py
File metadata and controls
25 lines (19 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import argparse
from sampler import *
parser = argparse.ArgumentParser()
parser.add_argument('db_path', metavar='db', type=str,
help='sampler (db) destination path')
parser.add_argument('--curve_idx', metavar='i', type=int,
help='''
index of the desired curve to plot from the db
if not specified than all the curves are saved to '/db' folder''')
def main(db_path, curve_idx=None):
with open(db_path, 'rb') as input_file:
db_sampler = dill.load(input_file)
if curve_idx is None:
db_sampler.plot_all_db()
else:
db_sampler.plot_with_figure(curve_idx)
if __name__ == '__main__':
args = parser.parse_args()
main(**vars(args))