-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrunValidOrchestrator.py
33 lines (27 loc) · 1.11 KB
/
runValidOrchestrator.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
import os
import sys
import argparse
def main():
parser = argparse.ArgumentParser(description='Main orchestrator to start or restart ' + \
'calibration for WRF-Hydro')
parser.add_argument('script_path', metavar='script_path', type=str, nargs='+',
help='Path of the PyWrfHydroCalib directory.')
parser.add_argument('jobID', metavar='jobID', type=str, nargs='+',
help='Job ID specific to calibration experiment.')
parser.add_argument('--optDbPath', type=str, nargs='?',
help='Optional alternative path to SQLite DB file.')
args = parser.parse_args()
script_path = args.script_path[0]
jobID = args.jobID[0]
try:
opt_path = args.optDbPath
except:
opt_path = ""
for valid_type in ['CTRL', 'BEST']:
cmd = "python %s/validOrchestrator.py %s %s --optDbPath %s" %(script_path, jobID, valid_type, opt_path)
print(cmd)
ret = os.system(cmd)
if(ret!=0):
print("Error running %s" %cmd)
if __name__ == "__main__" :
main()