-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspider2.py
More file actions
37 lines (29 loc) · 1.08 KB
/
Copy pathspider2.py
File metadata and controls
37 lines (29 loc) · 1.08 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
import os
import yaml
import re
import numpy as np
import argparse
def gen_args():
parser = argparse.ArgumentParser(description='Davidson')
parser.add_argument('-f', '--yaml', type=str, default=None, help='the yaml file to read')
args = parser.parse_args()
return args
args = gen_args()
def main():
with open(args.yaml, 'r') as y:
tmp = yaml.safe_load(y)
func = tmp['functional']
n_vec = tmp['N_states']
i_p = tmp['initial_guess'][0] + tmp['preconditioner'][0]
mol = tmp['molecule']
N_itr = tmp['N_itr']
N_mv = tmp['N_mv']
wall_t = tmp['wall time']
ip_t = tmp['precondition time'] + tmp['initial guess time']
ip_t_p = 100*ip_t/tmp['wall time']
RMSE = tmp['initial-final difference'] if tmp['initial-final difference'] else 0
overalp = tmp['initial-final overlap']
print(f"{func:<6} {n_vec:<2} {i_p:<4} {mol:<30} {N_itr:<5} {N_mv:<5} {wall_t:<7.0f} {ip_t:<7.1f} {ip_t_p:<5.1f} {RMSE:<5.3f} {overalp:<5.4f}")
if __name__ == "__main__":
if args.yaml:
main()