mg-pso-gui 0.1.232__py3-none-any.whl → 0.1.235__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.1.232.dist-info → mg_pso_gui-0.1.235.dist-info}/METADATA +1 -1
- {mg_pso_gui-0.1.232.dist-info → mg_pso_gui-0.1.235.dist-info}/RECORD +9 -9
- mgpsogui/gui/HomePage.py +13 -2
- mgpsogui/gui/OptionManager.py +2 -2
- mgpsogui/gui/SetupTab/StepView.py +31 -10
- mgpsogui/util/PSORunner.py +5 -52
- {mg_pso_gui-0.1.232.dist-info → mg_pso_gui-0.1.235.dist-info}/WHEEL +0 -0
- {mg_pso_gui-0.1.232.dist-info → mg_pso_gui-0.1.235.dist-info}/entry_points.txt +0 -0
- {mg_pso_gui-0.1.232.dist-info → mg_pso_gui-0.1.235.dist-info}/top_level.txt +0 -0
@@ -1,8 +1,8 @@
|
|
1
1
|
mgpsogui/__init__.py,sha256=q7AfBjeJABnFtbsZnsObpUwaXKPDVYtz46G6MKXLF74,42
|
2
2
|
mgpsogui/mgpsogui.py,sha256=NIZmyNcbwC8EgSwf1ubdMUSJscrIEgoD4jLYziqHQ-k,148
|
3
3
|
mgpsogui/start.yaml,sha256=ZjCVLb-MLqAxrGRm9kA7_SDpa-45EuKIELNQ2QqCAiU,4713
|
4
|
-
mgpsogui/gui/HomePage.py,sha256=
|
5
|
-
mgpsogui/gui/OptionManager.py,sha256=
|
4
|
+
mgpsogui/gui/HomePage.py,sha256=F0QIzkkM4cDvaFZq_Uy5cDFL6wb1-HV8AB44K-QqB4o,23227
|
5
|
+
mgpsogui/gui/OptionManager.py,sha256=DxOZbos8d1p3j3Krs534JJaCZKLl3hqmauPUx7lbr4o,16360
|
6
6
|
mgpsogui/gui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
7
|
mgpsogui/gui/PlatformTab/PlatformTab.py,sha256=q8x_tvVgSoyGINuQbivXRThF3gaSSfg8X_dsLSPv4F0,10492
|
8
8
|
mgpsogui/gui/PlatformTab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -19,7 +19,7 @@ mgpsogui/gui/SetupTab/ListParametersView.py,sha256=wYcDcaooYkw-y7XW6dJUwhTWxLuUU
|
|
19
19
|
mgpsogui/gui/SetupTab/OptimalParameterView.py,sha256=VKn-4BlVyqspFIOkbWsM0q9pYVsmqnSND0xP2hDKb60,1785
|
20
20
|
mgpsogui/gui/SetupTab/SetupTab.py,sha256=NmCPb9tGVJmUy1HG3G26y5RibtVZNeN9XFyomVnageQ,2792
|
21
21
|
mgpsogui/gui/SetupTab/StaticParameterView.py,sha256=iEG-UpBBlAJabZo3MG768oLqOROjUPc23tKOSd47IUc,2739
|
22
|
-
mgpsogui/gui/SetupTab/StepView.py,sha256=
|
22
|
+
mgpsogui/gui/SetupTab/StepView.py,sha256=iRmxrr8UC8PDemTZUd0AUZrgpT5GjQLIKgzRYe8eIoc,11558
|
23
23
|
mgpsogui/gui/SetupTab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
24
24
|
mgpsogui/gui/VisualizeTab/MatrixEditor.py,sha256=JPQmfljdddIwHtTKpFqUdk7hRzVdX-IKl4neOk3DsjM,3132
|
25
25
|
mgpsogui/gui/VisualizeTab/SideBar.py,sha256=MtZfDScNFN0fQ8DyPm6bZGJSrFRgT14fZeUq-qc61O8,21936
|
@@ -37,7 +37,7 @@ mgpsogui/gui/images/test.png,sha256=MUnVpRK-isxhEHzx4Q6Yh0M6FRZD1qvgCHH2XmiSBbk,
|
|
37
37
|
mgpsogui/gui/images/trash.png,sha256=j8cf0kWbJd-4Jp20lUVV1o1NSeQ4v1Ej4gfcIA3DVRQ,2958
|
38
38
|
mgpsogui/gui/images/up.png,sha256=AQvFWCUqSQNaQ1E6LKZ9zNfSvW6t4mgy8uswdg9T2Hg,2457
|
39
39
|
mgpsogui/util/GraphGenerator.py,sha256=7JRq4um5UJd5tAYmffHWi558pcCMAwd6k3yvO0kEbPk,31779
|
40
|
-
mgpsogui/util/PSORunner.py,sha256=
|
40
|
+
mgpsogui/util/PSORunner.py,sha256=kp2vv46RKmbOuWgLSXT4jLb-QDQAeCkuWfb18a8PeT8,9155
|
41
41
|
mgpsogui/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
42
42
|
mgpsogui/util/debug.py,sha256=Swzny9_1S-CCONWGssj9iDoSpbwu5Vr4f95g_9L8bec,19759
|
43
43
|
mgpsogui/util/helpers.py,sha256=Ht2rge_4pGO7halz6KoLsL2eukB0k2tlkx68lBBmBA8,2669
|
@@ -62,8 +62,8 @@ mgpsogui/util/recosu/utils/trace_writer.py,sha256=V9BJlOjCbNYGoXGEk3CF5wjifBxvar
|
|
62
62
|
mgpsogui/util/recosu/utils/utils.py,sha256=QB8vftq3142ekG0ORjz0ZBHU5YknXbR0oTsrxrPAsF0,3951
|
63
63
|
mgpsogui/util/recosu/utils/plot/__init__.py,sha256=h1KjM7_tNDv351pcwt8A6Ibb1jhwWyx5Gbu-zj-sI3Q,71
|
64
64
|
mgpsogui/util/recosu/utils/plot/cost_steps.py,sha256=1Ce11AJyweWkmvjXPxEygzS-h8yVLmQEDLS53yjPLqQ,3779
|
65
|
-
mg_pso_gui-0.1.
|
66
|
-
mg_pso_gui-0.1.
|
67
|
-
mg_pso_gui-0.1.
|
68
|
-
mg_pso_gui-0.1.
|
69
|
-
mg_pso_gui-0.1.
|
65
|
+
mg_pso_gui-0.1.235.dist-info/METADATA,sha256=UPlCXaCcaUw1B0uU1kbpw7uZU0LefS8QnqJVtx2VGrE,9456
|
66
|
+
mg_pso_gui-0.1.235.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
67
|
+
mg_pso_gui-0.1.235.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
|
68
|
+
mg_pso_gui-0.1.235.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
|
69
|
+
mg_pso_gui-0.1.235.dist-info/RECORD,,
|
mgpsogui/gui/HomePage.py
CHANGED
@@ -74,6 +74,15 @@ class App(customtkinter.CTk):
|
|
74
74
|
self.open_file = "None"
|
75
75
|
self.csv_data = None
|
76
76
|
|
77
|
+
self.sensitivity_file = tk.StringVar()
|
78
|
+
self.sensitivity_file.set("No files found...")
|
79
|
+
|
80
|
+
self.sampling_method = tk.StringVar()
|
81
|
+
self.sampling_method.set("Halton")
|
82
|
+
|
83
|
+
self.sampling_output = tk.StringVar()
|
84
|
+
self.sampling_output.set("Replace")
|
85
|
+
|
77
86
|
self.selected_csv2 = tk.StringVar()
|
78
87
|
self.selected_csv2.set("No files found...")
|
79
88
|
self.open_file2 = "None"
|
@@ -240,7 +249,7 @@ class App(customtkinter.CTk):
|
|
240
249
|
mode = self.option_manager.get_arguments()['mode'].get()
|
241
250
|
self.service_url.configure(textvariable=self.option_manager.get_arguments()['urls'][mode])
|
242
251
|
|
243
|
-
if mode == "Optimization
|
252
|
+
if mode == "Optimization":
|
244
253
|
self.test_button.configure(state="normal")
|
245
254
|
self.test_button.configure(fg_color=get_color("CTkButton"))
|
246
255
|
self.download_button.configure(state="normal")
|
@@ -378,6 +387,8 @@ class App(customtkinter.CTk):
|
|
378
387
|
param['default_value'] = param['optimal_value']
|
379
388
|
self.testing = False
|
380
389
|
|
390
|
+
metrics["sensitivity_analysis_path"] = self.sensitivity_file.get()
|
391
|
+
|
381
392
|
self.progress_data = None
|
382
393
|
self.calibration_data = None
|
383
394
|
|
@@ -569,7 +580,7 @@ class App(customtkinter.CTk):
|
|
569
580
|
|
570
581
|
# Parse data into interface
|
571
582
|
mode = self.option_manager.get_arguments()['mode'].get()
|
572
|
-
if mode == "Optimization
|
583
|
+
if mode == "Optimization":
|
573
584
|
if (os.path.exists(os.path.join(folder, 'error.txt'))):
|
574
585
|
data = hp.parse_pso_error(os.path.join(folder, 'error.txt'), len(self.option_manager.get_steps()))
|
575
586
|
print(data)
|
mgpsogui/gui/OptionManager.py
CHANGED
@@ -22,7 +22,7 @@ class OptionManager():
|
|
22
22
|
self.steps = []
|
23
23
|
self.service_parameters = {}
|
24
24
|
|
25
|
-
self.service_modes = ["Sampling
|
25
|
+
self.service_modes = ["Sampling", "Sensitivity Analysis", "Optimization"]
|
26
26
|
for mode in self.service_modes:
|
27
27
|
self.arguments["urls"][mode] = sv()
|
28
28
|
|
@@ -32,7 +32,7 @@ class OptionManager():
|
|
32
32
|
self.arguments['url'].set("")
|
33
33
|
for mode in self.service_modes:
|
34
34
|
self.arguments["urls"][mode].set("")
|
35
|
-
self.arguments['mode'].set("Optimization
|
35
|
+
self.arguments['mode'].set("Optimization")
|
36
36
|
self.arguments['files'] = {}
|
37
37
|
self.arguments['calibration_parameters'].clear()
|
38
38
|
self.arguments['figure_parameters'].clear()
|
@@ -89,19 +89,40 @@ class StepView(CTkScrollableFrame):
|
|
89
89
|
files = [f for f in os.listdir(folder) if f.endswith('.csv')]
|
90
90
|
|
91
91
|
if len(files) == 0:
|
92
|
-
files = ["No CSV files found! Run sampling first"]
|
92
|
+
files = [" No CSV files found! Run sampling first! "]
|
93
|
+
elif self.home_page.sensitivity_file.get() not in files:
|
94
|
+
self.home_page.sensitivity_file.set(files[0])
|
93
95
|
|
94
96
|
header_padding_x = (5, 5)
|
95
97
|
header_padding_y = (10, 10)
|
96
98
|
|
97
|
-
self.file_selector_frame = CTkFrame(self.containerFrame
|
99
|
+
self.file_selector_frame = CTkFrame(self.containerFrame)
|
98
100
|
self.file_selector_frame.grid(row=0, column=0, sticky="nsew", columnspan=2)
|
99
101
|
self.logo_label = CTkLabel(self.file_selector_frame, text="Select File:")
|
100
|
-
self.logo_label.grid(row=0, column=0, padx=(
|
102
|
+
self.logo_label.grid(row=0, column=0, padx=(10, 10), pady=header_padding_y)
|
101
103
|
|
102
|
-
self.file_selector = CTkOptionMenu(self.file_selector_frame, values=files, width=50)
|
103
|
-
self.file_selector.grid(row=0, column=1, padx=(
|
104
|
-
|
104
|
+
self.file_selector = CTkOptionMenu(self.file_selector_frame, values=files, width=50, variable=self.home_page.sensitivity_file)
|
105
|
+
self.file_selector.grid(row=0, column=1, padx=(10, 10), pady=header_padding_y)
|
106
|
+
|
107
|
+
row += 1
|
108
|
+
|
109
|
+
if (self.mode == "Sampling"):
|
110
|
+
header_padding_x = (5, 5)
|
111
|
+
header_padding_y = (10, 10)
|
112
|
+
|
113
|
+
self.file_selector_frame = CTkFrame(self.containerFrame)
|
114
|
+
self.file_selector_frame.grid(row=0, column=0, sticky="nsew", columnspan=2)
|
115
|
+
self.logo_label = CTkLabel(self.file_selector_frame, text="Sampling Method:")
|
116
|
+
self.logo_label.grid(row=0, column=0, padx=(10, 10), pady=header_padding_y)
|
117
|
+
|
118
|
+
self.sampling_method = CTkOptionMenu(self.file_selector_frame, values=["Halton", "Random"], width=50, variable=self.home_page.sampling_method)
|
119
|
+
self.sampling_method.grid(row=0, column=1, padx=(10, 10), pady=header_padding_y)
|
120
|
+
|
121
|
+
self.logo_label2 = CTkLabel(self.file_selector_frame, text="Output:")
|
122
|
+
self.logo_label2.grid(row=0, column=0, padx=(20, 10), pady=header_padding_y)
|
123
|
+
|
124
|
+
self.output_method = CTkOptionMenu(self.file_selector_frame, values=["Replace", "Append"], width=50, variable=self.home_page.sampling_output)
|
125
|
+
self.output_method.grid(row=0, column=1, padx=(10, 10), pady=header_padding_y)
|
105
126
|
|
106
127
|
row += 1
|
107
128
|
|
@@ -120,7 +141,7 @@ class StepView(CTkScrollableFrame):
|
|
120
141
|
down_func = lambda index=index: (self.clear(), self.option_manager.move_step_down(index), self.render())
|
121
142
|
remove_func = lambda index=index: (self.clear(), self.option_manager.remove_step(index), self.render())
|
122
143
|
|
123
|
-
if (self.mode == "Optimization
|
144
|
+
if (self.mode == "Optimization"):
|
124
145
|
button_container = CTkFrame(self.containerFrame, width=200)
|
125
146
|
button_container.grid(row=row, column=1, sticky="nse", padx=(10, 10), pady=(10, 10))
|
126
147
|
button_container.grid_rowconfigure(0, weight=1)
|
@@ -135,7 +156,7 @@ class StepView(CTkScrollableFrame):
|
|
135
156
|
|
136
157
|
row += 1
|
137
158
|
|
138
|
-
if step['open'] or (self.mode == "Sampling
|
159
|
+
if step['open'] or (self.mode == "Sampling"or self.mode == "Sensitivity Analysis"):
|
139
160
|
bounds = BoundsList.BoundsList(
|
140
161
|
self.containerFrame, option_manager=self.option_manager, step_index=index)
|
141
162
|
bounds.grid(row=row, column=0, padx=(10, 10),
|
@@ -153,11 +174,11 @@ class StepView(CTkScrollableFrame):
|
|
153
174
|
row += 1
|
154
175
|
index += 1
|
155
176
|
|
156
|
-
if (self.mode != "Optimization
|
177
|
+
if (self.mode != "Optimization"):
|
157
178
|
break
|
158
179
|
|
159
180
|
# Create an "Add step button that is centered
|
160
|
-
if (self.mode == "Optimization
|
181
|
+
if (self.mode == "Optimization" or len(self.steps) == 0):
|
161
182
|
CTkButton(self.containerFrame, text="Add Group", command=self.create_new_step).grid(
|
162
183
|
row=row, columnspan=2, column=0, padx=(10, 10), pady=(10, 10), sticky="ew")
|
163
184
|
|
mgpsogui/util/PSORunner.py
CHANGED
@@ -76,7 +76,7 @@ def run_process(stdout_queue, stderr_queue, results_queue, data, folder):
|
|
76
76
|
|
77
77
|
config = {}
|
78
78
|
|
79
|
-
if my_mode == "Sampling
|
79
|
+
if my_mode == "Sampling":
|
80
80
|
config = {
|
81
81
|
'service_timeout': int(calibration_map['service_timeout']),
|
82
82
|
'http_retry': int(calibration_map['http_retry']),
|
@@ -86,7 +86,7 @@ def run_process(stdout_queue, stderr_queue, results_queue, data, folder):
|
|
86
86
|
'read_timeout': int(calibration_map['read_timeout']),
|
87
87
|
'step_trace': os.path.join(folder, 'pso_step_trace.json')
|
88
88
|
}
|
89
|
-
elif my_mode == "Optimization
|
89
|
+
elif my_mode == "Optimization":
|
90
90
|
config = {
|
91
91
|
'service_timeout': int(calibration_map['service_timeout']),
|
92
92
|
'http_retry': int(calibration_map['http_retry']),
|
@@ -139,11 +139,11 @@ def run_process(stdout_queue, stderr_queue, results_queue, data, folder):
|
|
139
139
|
print(trace, flush=True)
|
140
140
|
print("\n", flush=True)
|
141
141
|
|
142
|
-
elif my_mode == "Sensitivity
|
142
|
+
elif my_mode == "Sensitivity Analysis":
|
143
143
|
|
144
|
-
print("Running
|
144
|
+
print("Running Sensitivity Analysis", flush=True)
|
145
145
|
|
146
|
-
shutil.copyfile(
|
146
|
+
shutil.copyfile(data["sensitivity_analysis_path"], os.path.join(folder, 'results', 'trace.csv'))
|
147
147
|
trace_path = os.path.join(folder, 'results', 'trace.csv')
|
148
148
|
|
149
149
|
# Get list of parameters from steps
|
@@ -185,53 +185,6 @@ def run_process(stdout_queue, stderr_queue, results_queue, data, folder):
|
|
185
185
|
|
186
186
|
sensitivity_analysis(args['url'], request_path, trace_path, output_directory)
|
187
187
|
|
188
|
-
print("Finished Sensitivity Analysis", flush=True)
|
189
|
-
elif my_mode == "Sensitivity: Random":
|
190
|
-
|
191
|
-
print("Running Random Sensitivity Analysis", flush=True)
|
192
|
-
|
193
|
-
shutil.copyfile(os.path.join(folder, 'results', 'random_trace.csv'), os.path.join(folder, 'results', 'trace.csv'))
|
194
|
-
trace_path = os.path.join(folder, 'results', 'trace.csv')
|
195
|
-
|
196
|
-
# Get list of parameters from steps
|
197
|
-
parameters = []
|
198
|
-
for param in steps[0]['param']:
|
199
|
-
parameters.append(param['name'])
|
200
|
-
|
201
|
-
request_json = {
|
202
|
-
"metainfo": {
|
203
|
-
"service_url": None,
|
204
|
-
"description": "",
|
205
|
-
"name": "",
|
206
|
-
"mode": "async"
|
207
|
-
},
|
208
|
-
"parameter": [
|
209
|
-
{
|
210
|
-
"name": "parameters",
|
211
|
-
"value": parameters
|
212
|
-
},
|
213
|
-
{
|
214
|
-
"name": "positiveBestMetrics",
|
215
|
-
"value": ["ns","kge","mns","kge09","nslog2"]
|
216
|
-
},
|
217
|
-
{
|
218
|
-
"name": "zeroBestMetrics",
|
219
|
-
"value": ["pbias","rmse"]
|
220
|
-
}
|
221
|
-
]
|
222
|
-
}
|
223
|
-
|
224
|
-
with open(os.path.join(folder, 'results', 'request.json'), 'w') as json_file:
|
225
|
-
json.dump(request_json, json_file, indent=4)
|
226
|
-
|
227
|
-
request_path = os.path.join(folder, 'results', 'request.json')
|
228
|
-
|
229
|
-
output_directory = os.path.join(folder, 'results')
|
230
|
-
|
231
|
-
print("Starting ", args['url'], request_path, trace_path, output_directory, flush=True)
|
232
|
-
|
233
|
-
sensitivity_analysis(args['url'], request_path, trace_path, output_directory)
|
234
|
-
|
235
188
|
print("Finished Sensitivity Analysis", flush=True)
|
236
189
|
else:
|
237
190
|
print("Running MG-PSO Optimization...\n", flush=True)
|
File without changes
|
File without changes
|
File without changes
|