-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAssembleModelFolder.py
More file actions
31 lines (26 loc) · 888 Bytes
/
AssembleModelFolder.py
File metadata and controls
31 lines (26 loc) · 888 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
26
27
28
29
30
31
import os
import subprocess
python = os.environ['PYTHON36']
keyword = "parab"
variable = "x_max"
point = "random"
model = "NET"
if keyword == "parab":
case_study = "Parabolic"
elif keyword == "airf":
case_study = "Airfoil"
else:
raise ValueError("Chose one between parab and airf")
base_path = "CaseStudies/"+case_study+"/Models/"
directories_model = [d for d in os.listdir(base_path) if os.path.isdir(os.path.join(base_path, d))]
for directory in directories_model:
if "Depth_" in directory and variable in directory:
print("\n")
print(directory)
arguments = list()
arguments.append(str(directory))
arguments.append(str(case_study))
arguments.append(str(point))
arguments.append(str(model))
p = subprocess.Popen([python, "MultiLevModel.py"] + arguments)
p.wait()