mg-pso-gui 0.2.61__py3-none-any.whl → 0.2.63__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mg_pso_gui-0.2.61.dist-info → mg_pso_gui-0.2.63.dist-info}/METADATA +1 -1
- {mg_pso_gui-0.2.61.dist-info → mg_pso_gui-0.2.63.dist-info}/RECORD +8 -8
- {mg_pso_gui-0.2.61.dist-info → mg_pso_gui-0.2.63.dist-info}/WHEEL +1 -1
- mgpsogui/gui/SetupTab/BoundsList.py +20 -3
- mgpsogui/gui/SetupTab/StepView.py +1 -0
- mgpsogui/util/PSORunner.py +32 -2
- {mg_pso_gui-0.2.61.dist-info → mg_pso_gui-0.2.63.dist-info}/entry_points.txt +0 -0
- {mg_pso_gui-0.2.61.dist-info → mg_pso_gui-0.2.63.dist-info}/top_level.txt +0 -0
@@ -13,7 +13,7 @@ mgpsogui/gui/RunTab/OptimalParameterView.py,sha256=nliUEWA840cPBQt7wjiZ-L7uBOp_o
|
|
13
13
|
mgpsogui/gui/RunTab/RunTab.py,sha256=47_r8K-e7f8zs93_2iPYnNBzHDHZejtedk7iSElkubU,5608
|
14
14
|
mgpsogui/gui/RunTab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
15
15
|
mgpsogui/gui/SetupTab/BoundsEditorWindow.py,sha256=U64oaiDIOaimjbqKMz5rQNq2o1SrQtrRHDdTYQ9ux1s,2870
|
16
|
-
mgpsogui/gui/SetupTab/BoundsList.py,sha256=
|
16
|
+
mgpsogui/gui/SetupTab/BoundsList.py,sha256=7MCAiiPmhkcPQwDNMws12DezkwQhFc9WI54B7tE4wyk,12859
|
17
17
|
mgpsogui/gui/SetupTab/CustomFunctionEditorWindow.py,sha256=yx0dHSNa7fGy99Q6qFcI6j9r8p0DlV3iOBgyPMGd8pM,2884
|
18
18
|
mgpsogui/gui/SetupTab/CustomFunctionMetrics.py,sha256=vOJpElbTgz043m6JYwe9xz_2MBHg985S6KdbJkJERW4,5923
|
19
19
|
mgpsogui/gui/SetupTab/FunctionsList.py,sha256=ntbIUs8q2Tm3KfBLleT7uL0gynwYuVycwvXv8vude3c,6611
|
@@ -22,7 +22,7 @@ mgpsogui/gui/SetupTab/ListParametersView.py,sha256=mkGaC5cXhEOy5oD0MbTyK9z7VGZp0
|
|
22
22
|
mgpsogui/gui/SetupTab/OverrideParameterMetrics.py,sha256=rBfaSitYDOajbHvyi2TfoXAHYlz1cCt028UVpIJ_Dc0,3369
|
23
23
|
mgpsogui/gui/SetupTab/OverrideParameterWindow.py,sha256=UpZDxTaFxee0BeviUYXeiIlMNYNy00qz3zlMlM5VcXE,1291
|
24
24
|
mgpsogui/gui/SetupTab/SetupTab.py,sha256=3V8LYvg5ulTll1hhguB_XpSoOR-w72vHh_Z3gw3nCxc,2758
|
25
|
-
mgpsogui/gui/SetupTab/StepView.py,sha256=
|
25
|
+
mgpsogui/gui/SetupTab/StepView.py,sha256=Zoz-gw1UWbdA8j_0VIE9lGze4CJ0udSXJexB3HLB6Dk,8989
|
26
26
|
mgpsogui/gui/SetupTab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
27
27
|
mgpsogui/gui/VisualizeTab/MatrixEditor.py,sha256=Gzyl2hRgjIfO5n0bCZZoXp_vOFvfsJPaGXDUMeRQg10,3171
|
28
28
|
mgpsogui/gui/VisualizeTab/SideBar.py,sha256=wPjzA8ZZsCTxBKN0_6-_ABtU5BeHqytNAWfKCWAPoe8,22106
|
@@ -44,7 +44,7 @@ mgpsogui/gui/images/test.png,sha256=MUnVpRK-isxhEHzx4Q6Yh0M6FRZD1qvgCHH2XmiSBbk,
|
|
44
44
|
mgpsogui/gui/images/trash.png,sha256=j8cf0kWbJd-4Jp20lUVV1o1NSeQ4v1Ej4gfcIA3DVRQ,2958
|
45
45
|
mgpsogui/gui/images/up.png,sha256=AQvFWCUqSQNaQ1E6LKZ9zNfSvW6t4mgy8uswdg9T2Hg,2457
|
46
46
|
mgpsogui/util/GraphGenerator.py,sha256=dKzDPMK-0S6j1yIp5xoQIgN9GTKMhGpboAXjofCpmIk,31973
|
47
|
-
mgpsogui/util/PSORunner.py,sha256=
|
47
|
+
mgpsogui/util/PSORunner.py,sha256=Rt3bFxiZlcNqK74kAMfFLfI9XCSGRZU717WW6NX0wqk,23115
|
48
48
|
mgpsogui/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
49
49
|
mgpsogui/util/debug.py,sha256=Swzny9_1S-CCONWGssj9iDoSpbwu5Vr4f95g_9L8bec,19759
|
50
50
|
mgpsogui/util/helpers.py,sha256=Ht2rge_4pGO7halz6KoLsL2eukB0k2tlkx68lBBmBA8,2669
|
@@ -69,8 +69,8 @@ mgpsogui/util/recosu/utils/trace_writer.py,sha256=V9BJlOjCbNYGoXGEk3CF5wjifBxvar
|
|
69
69
|
mgpsogui/util/recosu/utils/utils.py,sha256=QB8vftq3142ekG0ORjz0ZBHU5YknXbR0oTsrxrPAsF0,3951
|
70
70
|
mgpsogui/util/recosu/utils/plot/__init__.py,sha256=h1KjM7_tNDv351pcwt8A6Ibb1jhwWyx5Gbu-zj-sI3Q,71
|
71
71
|
mgpsogui/util/recosu/utils/plot/cost_steps.py,sha256=1Ce11AJyweWkmvjXPxEygzS-h8yVLmQEDLS53yjPLqQ,3779
|
72
|
-
mg_pso_gui-0.2.
|
73
|
-
mg_pso_gui-0.2.
|
74
|
-
mg_pso_gui-0.2.
|
75
|
-
mg_pso_gui-0.2.
|
76
|
-
mg_pso_gui-0.2.
|
72
|
+
mg_pso_gui-0.2.63.dist-info/METADATA,sha256=G3hZZsJnO5n7qnZOyGF9Oqem9TEI7em2uiAnSxduzYc,9455
|
73
|
+
mg_pso_gui-0.2.63.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
74
|
+
mg_pso_gui-0.2.63.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
|
75
|
+
mg_pso_gui-0.2.63.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
|
76
|
+
mg_pso_gui-0.2.63.dist-info/RECORD,,
|
@@ -62,6 +62,8 @@ class BoundsList(CTkFrame):
|
|
62
62
|
index = 0
|
63
63
|
|
64
64
|
self.tooltip_list = []
|
65
|
+
|
66
|
+
mode = self.option_manager.get_mode()
|
65
67
|
|
66
68
|
self.containerFrame = CTkFrame(self, fg_color="transparent")
|
67
69
|
self.containerFrame.grid(row=0, column=0, padx=(5, 5), pady=(5, 5), sticky="nsew")
|
@@ -71,9 +73,13 @@ class BoundsList(CTkFrame):
|
|
71
73
|
|
72
74
|
CTkLabel(self.containerFrame, text="Type:").grid(row=row, column=0, padx=(5, 5), pady=(5, 5), sticky="nsew")
|
73
75
|
CTkLabel(self.containerFrame, text="Name:").grid(row=row, column=1, padx=(5, 5), pady=(5, 5), sticky="nsew")
|
74
|
-
|
75
|
-
|
76
|
-
|
76
|
+
|
77
|
+
if mode != "Sensitivity Analysis":
|
78
|
+
CTkLabel(self.containerFrame, text="Bounds:").grid(row=row, column=2, columnspan=2, padx=(5, 5), pady=(5, 5), sticky="nsew")
|
79
|
+
|
80
|
+
if mode == "Optimization":
|
81
|
+
CTkLabel(self.containerFrame, text="Default:").grid(row=row, column=4, padx=(5, 5), pady=(5, 5), sticky="nsew")
|
82
|
+
CTkLabel(self.containerFrame, text="Strategy:").grid(row=row, column=5, padx=(5, 5), pady=(5, 5), sticky="nsew")
|
77
83
|
row += 1
|
78
84
|
|
79
85
|
bounds = self.option_manager.get_steps()[self.step_index]["parameter_objects"]
|
@@ -112,6 +118,12 @@ class BoundsList(CTkFrame):
|
|
112
118
|
bb.grid(row=row, column=2, padx=(5, 5), pady=(5, 5), sticky="new")
|
113
119
|
ctt(bb, delay=0.1, alpha=0.95, message="Delete this bound...")
|
114
120
|
else:
|
121
|
+
|
122
|
+
if mode == "Sensitivity Analysis":
|
123
|
+
row += 1
|
124
|
+
index += 1
|
125
|
+
continue
|
126
|
+
|
115
127
|
bounds_min = CTkEntry(self.containerFrame)
|
116
128
|
vcmd = (self.register(self.validate_number), '%P', cc, bounds_min)
|
117
129
|
bounds_min.grid(row=row, column=2, padx=(5, 5), pady=(5, 5), sticky="new")
|
@@ -125,6 +137,11 @@ class BoundsList(CTkFrame):
|
|
125
137
|
self.validate_number(bounds_max.get(), cc, bounds_max)
|
126
138
|
tt2 = ctt(bounds_max, delay=0.1, alpha=0.95, message="...")
|
127
139
|
|
140
|
+
if mode == "Sampling: Random" or mode == "Sampling: Halton":
|
141
|
+
row += 1
|
142
|
+
index += 1
|
143
|
+
continue
|
144
|
+
|
128
145
|
default_value = CTkEntry(self.containerFrame)
|
129
146
|
default_value.grid(row=row, column=4, padx=(5, 5), pady=(5, 5), sticky="new")
|
130
147
|
default_value.configure(textvariable=bound["default_value"])
|
@@ -85,6 +85,7 @@ class StepView(CTkScrollableFrame):
|
|
85
85
|
|
86
86
|
if (self.mode == "Sensitivity Analysis"):
|
87
87
|
folder = self.option_manager.get_project_folder()
|
88
|
+
folder = os.path.join(folder, "results")
|
88
89
|
|
89
90
|
# File all CSV files in folder and put them into list with strings as path
|
90
91
|
files = []
|
mgpsogui/util/PSORunner.py
CHANGED
@@ -230,7 +230,15 @@ def run_sampling(data, mode, folder, results_queue):
|
|
230
230
|
|
231
231
|
output_steps = process_steps(data)
|
232
232
|
|
233
|
-
|
233
|
+
trace_file = os.path.join(folder, 'results', mode + '_trace.csv')
|
234
|
+
file_output_mode = data["sampling_output_mode"]
|
235
|
+
if file_output_mode == "Append":
|
236
|
+
# Backup trace file if it exists
|
237
|
+
if os.path.exists(trace_file):
|
238
|
+
shutil.copyfile(trace_file, trace_file + ".bak")
|
239
|
+
|
240
|
+
|
241
|
+
config['step_trace'] = os.path.join(folder, 'pso_step_trace.json') # Do we need this?
|
234
242
|
|
235
243
|
print("Parsing Parameters...\n", flush=True)
|
236
244
|
print("steps: ", flush=True)
|
@@ -256,12 +264,34 @@ def run_sampling(data, mode, folder, results_queue):
|
|
256
264
|
mode,
|
257
265
|
conf=config,
|
258
266
|
metainfo=metainfo if len(metainfo) > 0 else None,
|
259
|
-
trace_file=
|
267
|
+
trace_file=trace_file,
|
260
268
|
offset=int(pp('offset', parameter_map)))
|
261
269
|
results_queue.put(trace)
|
262
270
|
print(trace, flush=True)
|
263
271
|
print("\n", flush=True)
|
264
272
|
|
273
|
+
if file_output_mode == "Append" and os.path.exists(trace_file + ".bak"):
|
274
|
+
# Read the backup file
|
275
|
+
with open(trace_file + ".bak", 'r') as f2:
|
276
|
+
backup_lines = f2.readlines()
|
277
|
+
|
278
|
+
# Read the trace file
|
279
|
+
with open(trace_file, 'r') as f:
|
280
|
+
trace_lines = f.readlines()
|
281
|
+
|
282
|
+
# Extract headers
|
283
|
+
backup_header = backup_lines[0]
|
284
|
+
trace_header = trace_lines[0]
|
285
|
+
|
286
|
+
# Combine data ensuring headers are not duplicated
|
287
|
+
with open(trace_file, 'w') as f:
|
288
|
+
f.write(backup_header)
|
289
|
+
f.writelines(backup_lines[1:])
|
290
|
+
f.writelines(trace_lines[1:] if trace_header == backup_header else trace_lines)
|
291
|
+
|
292
|
+
# Remove the backup file
|
293
|
+
os.remove(trace_file + ".bak")
|
294
|
+
|
265
295
|
def run_optimization(data, folder, results_queue):
|
266
296
|
"""_summary_
|
267
297
|
|
File without changes
|
File without changes
|