-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpathChangeLocal.py
More file actions
58 lines (35 loc) · 1.89 KB
/
pathChangeLocal.py
File metadata and controls
58 lines (35 loc) · 1.89 KB
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
58
# New filepath to replace the original filepath
new_filepath = "D:/Main/GitHub/GenProgMO/results/"
old_filepath = "/ichec/work/mucom004c/fergals/toICHEC/results/"
new_filepath2 = "D:/Main/GitHub/GenProgMO/data/dogs-vs-cats/"
old_filepath2 = "/ichec/work/mucom004c/fergals/toICHEC/data/dogs-vs-cats/"
# ************************************************************************ #
with open("./algorithm/singleObjNeuroLGPBaseline.py", "r") as file:
content = file.read()
updated_content = content.replace(old_filepath , new_filepath)
with open("./algorithm/singleObjNeuroLGPBaseline.py", "w") as file:
file.write(updated_content)
# ************************************************************************ #
with open("./algorithm/singleObjNeuroLGPSurrogate.py", "r") as file:
content = file.read()
updated_content = content.replace(old_filepath , new_filepath)
with open("./algorithm/singleObjNeuroLGPSurrogate.py", "w") as file:
file.write(updated_content)
# ************************************************************************ #
with open("./algorithm/singleObjNeuroLGP.py", "r") as file:
content = file.read()
updated_content = content.replace(old_filepath , new_filepath)
with open("./algorithm/singleObjNeuroLGP.py", "w") as file:
file.write(updated_content)
# ************************************************************************ #
with open("experimentNeuroLGPcatsdogs.json", "r") as file:
content = file.read()
updated_content = content.replace(old_filepath , new_filepath)
with open("experimentNeuroLGPcatsdogs.json", "w") as file:
file.write(updated_content)
# ************************************************************************ #
with open("./problem/neuroevolution.py", "r") as file:
content = file.read()
updated_content = content.replace(old_filepath2 , new_filepath2)
with open("./problem/neuroevolution.py", "w") as file:
file.write(updated_content)