-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
43 lines (26 loc) · 915 Bytes
/
main.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
import argparse
import pickle
import sys
from module.simulation_manager import Launcher
from module.save_eco import BackUp
def get_parameters():
parser = argparse.ArgumentParser()
parser.add_argument('parameters', type=str,
help='A name of pickle file for parameters is required!')
args = parser.parse_args()
pickle_file = args.parameters
try:
parameters = pickle.load(open(pickle_file, mode='rb'))
except Exception as e:
print("Problems in loading", pickle_file)
raise e
return parameters
def main():
if sys.version_info[0] < 3:
raise Exception("Should use Python 3")
parameters_list = get_parameters()
for parameters in parameters_list:
results = Launcher.launch(parameters, single=False)
BackUp.save_data(results=results, parameters=parameters)
if __name__ == "__main__":
main()