-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexp_manager_file_creater.py
57 lines (44 loc) · 1.71 KB
/
exp_manager_file_creater.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
50
51
52
53
54
55
56
57
"""
Project: ProcessSim
Made By: Arno Kasper
Version: 1.0.0
"""
# Get the number of experiments from the experimental settings file
NUMBER_EXP = 100 #len(exp_dat.experimental_params_list)
MAX_NUMBER_JOBS = 1000
EXP_PER_JOB = 1
PATH = path = "C:/Users/Arno_ZenBook/Dropbox/Professioneel/Research/Model/peregrine_files/exp_manager_array_files_mdas/"
# Set looping variables
Exp_list = []
lower_limit = 0
upper_limit = 0 + EXP_PER_JOB - 1
# Create file information
for i in range(0, NUMBER_EXP):
Exp_spec_list = []
Exp_spec_list.append(lower_limit)
Exp_spec_list.append(upper_limit)
lower_limit += 1 + EXP_PER_JOB - 1
upper_limit += 1 + EXP_PER_JOB - 1
Exp_list.append(Exp_spec_list)
# Open template of the experiment manager
counter = 1
# Create a copy of the template with unique information
for i in range(0, len(Exp_list)):
exp_lower_limit = Exp_list[i][0]
exp_upper_limit = Exp_list[i][1]
exp_name = f"peregrine_exp_manager_{counter}.py"
name_path = PATH + exp_name
counter += 1
with open(name_path, "w+") as file:
string_exp_lower_limit = f"start_exp_index: int = {exp_lower_limit}"
string_exp_upper_limit = f"end_exp_index: int = {exp_upper_limit}"
file.write(string_exp_lower_limit)
file.write("\n")
file.write(string_exp_upper_limit)
file.write("\n")
with open("C:/Users/Arno_ZenBook/Dropbox/Professioneel/Research/Model/peregrine_files/empty_exp_activation_mdas.txt", "r") as template_file:
for line in template_file:
file.write(line)
file.close()
template_file.close()
print(f"SET ARRAY TO: --array=1-{counter-1}")