-
Notifications
You must be signed in to change notification settings - Fork 0
/
bva.py
executable file
·49 lines (32 loc) · 1.21 KB
/
bva.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env python
import argparse
import ConfigParser
import sys
import subprocess
defaultMessage='[BVA] config and run ... '
parser = argparse.ArgumentParser(description=defaultMessage)
parser.add_argument('-v','--version' , help='print BVA version', required=False,action='store_true',default=False)
parser.add_argument('-r','--run', help='run src/mcmc.py', required=False, \
action="store_true", default=False);
parser.add_argument('-n','--niter', help='specify niter in scipy.optimize.basinhopping', required=False, \
type=int, default=False);
parser.add_argument ('--verbose', help='output the parsed options', required=False,action='store_true',default=False);
if len(sys.argv)==1:
parser.print_help()
sys.exit(1)
results = parser.parse_args()
if results.run:
if results.niter==0:
subprocess.call(['./src/mcmc.py'])
sys.exit(0)
else if results.niter>0:
##DB
subprocess.call(['./src/mcmc.py',niter])
sys.exit(0)
else:
sys.exit(1)
if results.version:
print "BVA version: v_D2a"
if results.verbose:
print "results.run =", results.run
print "results.version =", results.version