mg-pso-gui 0.2.33__py3-none-any.whl → 0.2.35__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.33.dist-info → mg_pso_gui-0.2.35.dist-info}/METADATA +1 -1
- {mg_pso_gui-0.2.33.dist-info → mg_pso_gui-0.2.35.dist-info}/RECORD +7 -7
- mgpsogui/gui/HomePage.py +25 -20
- mgpsogui/util/PSORunner.py +60 -41
- {mg_pso_gui-0.2.33.dist-info → mg_pso_gui-0.2.35.dist-info}/WHEEL +0 -0
- {mg_pso_gui-0.2.33.dist-info → mg_pso_gui-0.2.35.dist-info}/entry_points.txt +0 -0
- {mg_pso_gui-0.2.33.dist-info → mg_pso_gui-0.2.35.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
|
|
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=
|
4
|
+
mgpsogui/gui/HomePage.py,sha256=3PVTCfsve6NPscNiSfePNsmVaFx4FTHqV_uTf6SsYqw,21549
|
5
5
|
mgpsogui/gui/OptionManager.py,sha256=HLVib_lHdMijykF78bJ9_PEl-oROuC8lxd1oBS7524U,21898
|
6
6
|
mgpsogui/gui/OptionManager_backup.py,sha256=TCWfPnHL2foN5id47jsi267lamRG6yGU6y_M29eOOJk,18530
|
7
7
|
mgpsogui/gui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -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=anp0ioxAz6uv8OFGtRhVHFrOsq3CRHN2x02ekMaKfn4,20830
|
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.35.dist-info/METADATA,sha256=YxvOLPbuFbEOeR3WLHdCtXJNzxPF4jTL1DGtZNWo7rM,9455
|
73
|
+
mg_pso_gui-0.2.35.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
74
|
+
mg_pso_gui-0.2.35.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
|
75
|
+
mg_pso_gui-0.2.35.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
|
76
|
+
mg_pso_gui-0.2.35.dist-info/RECORD,,
|
mgpsogui/gui/HomePage.py
CHANGED
@@ -217,6 +217,13 @@ class App(customtkinter.CTk):
|
|
217
217
|
try:
|
218
218
|
self.option_manager.set_path(filename)
|
219
219
|
self.option_manager.save_project(filename)
|
220
|
+
|
221
|
+
folder = self.option_manager.get_project_folder()
|
222
|
+
if not os.path.exists(folder):
|
223
|
+
os.makedirs(folder)
|
224
|
+
|
225
|
+
if not os.path.exists(os.path.join(folder, "results")):
|
226
|
+
os.makedirs(os.path.join(folder, "results"))
|
220
227
|
|
221
228
|
self.save_button.configure(text="Saved!")
|
222
229
|
self.after(3000, lambda: self.save_button.configure(text="Save"))
|
@@ -267,6 +274,14 @@ class App(customtkinter.CTk):
|
|
267
274
|
try:
|
268
275
|
|
269
276
|
self.option_manager.load_project(filename)
|
277
|
+
self.option_manager.set_path(filename)
|
278
|
+
|
279
|
+
folder = self.option_manager.get_project_folder()
|
280
|
+
if not os.path.exists(folder):
|
281
|
+
os.makedirs(folder)
|
282
|
+
|
283
|
+
if not os.path.exists(os.path.join(folder, "results")):
|
284
|
+
os.makedirs(os.path.join(folder, "results"))
|
270
285
|
|
271
286
|
self.refresh_step_view(0)
|
272
287
|
|
@@ -337,15 +352,15 @@ class App(customtkinter.CTk):
|
|
337
352
|
def run(self):
|
338
353
|
|
339
354
|
data = self.option_manager.get_all_data()
|
340
|
-
|
355
|
+
mode = self.option_manager.get_mode()
|
341
356
|
|
342
|
-
self.running_config =
|
357
|
+
self.running_config = data
|
343
358
|
|
344
|
-
if self.testing:
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
359
|
+
#if self.testing:
|
360
|
+
# steps = metrics['steps']
|
361
|
+
# for step in steps:
|
362
|
+
# for param in step['param']:
|
363
|
+
# param['default_value'] = param['optimal_value']
|
349
364
|
self.testing = False
|
350
365
|
|
351
366
|
self.progress_data = None
|
@@ -364,21 +379,11 @@ class App(customtkinter.CTk):
|
|
364
379
|
|
365
380
|
self.textbox.insert("0.0", "Starting job...\n\n")
|
366
381
|
self.textbox.insert("0.0", "Job Parameters:\n")
|
367
|
-
self.textbox.insert("0.0", json.dumps(
|
382
|
+
self.textbox.insert("0.0", json.dumps(data, indent=4) + "\n\n")
|
368
383
|
try:
|
369
|
-
|
370
|
-
folder = os.path.join(info['path'], info['name'])
|
371
|
-
|
372
|
-
if not os.path.exists(folder):
|
373
|
-
os.makedirs(folder)
|
374
|
-
|
375
|
-
if (os.path.exists(os.path.join(folder, 'output.txt'))):
|
376
|
-
os.remove(os.path.join(folder, 'output.txt'))
|
377
|
-
|
378
|
-
if (os.path.exists(os.path.join(folder, 'error.txt'))):
|
379
|
-
os.remove(os.path.join(folder, 'error.txt'))
|
384
|
+
folder = self.option_manager.get_project_folder()
|
380
385
|
|
381
|
-
self.train_process = Process(target=PSORunner.run_process, args=(stdout_queue, stderr_queue, results_queue,
|
386
|
+
self.train_process = Process(target=PSORunner.run_process, args=(stdout_queue, stderr_queue, results_queue, data, folder, mode))
|
382
387
|
self.train_process.daemon = True
|
383
388
|
self.train_process.start()
|
384
389
|
self.after(1000, self.watch_loop)
|
mgpsogui/util/PSORunner.py
CHANGED
@@ -30,53 +30,72 @@ def run_process(stdout_queue, stderr_queue, results_queue, data, folder, mode):
|
|
30
30
|
folder (_type_): _description_
|
31
31
|
mode (_type_): _description_
|
32
32
|
"""
|
33
|
+
try:
|
34
|
+
# Setup folders
|
35
|
+
if not os.path.exists(folder):
|
36
|
+
os.makedirs(folder)
|
33
37
|
|
34
|
-
|
35
|
-
|
36
|
-
os.makedirs(folder)
|
38
|
+
if not os.path.exists(os.path.join(folder, "results")):
|
39
|
+
os.makedirs(os.path.join(folder, "results"))
|
37
40
|
|
38
|
-
|
39
|
-
|
41
|
+
if (os.path.exists(os.path.join(folder, 'output.txt'))):
|
42
|
+
os.remove(os.path.join(folder, 'output.txt'))
|
43
|
+
|
44
|
+
if (os.path.exists(os.path.join(folder, 'error.txt'))):
|
45
|
+
os.remove(os.path.join(folder, 'error.txt'))
|
40
46
|
|
41
|
-
|
42
|
-
|
47
|
+
# Redirect stdout and stderr to files
|
48
|
+
old_stdout = sys.stdout
|
49
|
+
old_stderr = sys.stderr
|
43
50
|
|
44
|
-
|
45
|
-
os.
|
51
|
+
read_stdout, write_stdout = os.pipe()
|
52
|
+
read_stderr, write_stderr = os.pipe()
|
53
|
+
|
54
|
+
sys.stdout = os.fdopen(write_stdout, 'w')
|
55
|
+
sys.stderr = os.fdopen(write_stderr, 'w')
|
56
|
+
|
57
|
+
stdout_thread = threading.Thread(target=enqueue_output, args=(os.fdopen(read_stdout, 'r'), stdout_queue))
|
58
|
+
stderr_thread = threading.Thread(target=enqueue_output, args=(os.fdopen(read_stderr, 'r'), stderr_queue))
|
59
|
+
stdout_thread.daemon = True
|
60
|
+
stderr_thread.daemon = True
|
61
|
+
stdout_thread.start()
|
62
|
+
stderr_thread.start()
|
63
|
+
|
64
|
+
if mode == "Sampling: Halton":
|
65
|
+
run_sampling(data, "halton", folder, results_queue)
|
66
|
+
elif mode == "Sampling: Random":
|
67
|
+
run_sampling(data, "random", folder, results_queue)
|
68
|
+
elif mode == "Sensitivity Analysis":
|
69
|
+
run_sensitivity_analysis(data, folder, results_queue)
|
70
|
+
elif mode == "Optimization":
|
71
|
+
run_optimization(data, folder, results_queue)
|
72
|
+
else:
|
73
|
+
print("Invalid mode")
|
46
74
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
stdout_thread.daemon = True
|
60
|
-
stderr_thread.daemon = True
|
61
|
-
stdout_thread.start()
|
62
|
-
stderr_thread.start()
|
75
|
+
stdout_thread.join()
|
76
|
+
stderr_thread.join()
|
77
|
+
|
78
|
+
sys.stdout = old_stdout
|
79
|
+
sys.stderr = old_stderr
|
80
|
+
|
81
|
+
except Exception as e:
|
82
|
+
print("An exception occurred: ", flush=True)
|
83
|
+
print(str(e))
|
84
|
+
# Print stack trace
|
85
|
+
import traceback
|
86
|
+
traceback.print_exc()
|
63
87
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
stdout_thread.join()
|
76
|
-
stderr_thread.join()
|
77
|
-
|
78
|
-
sys.stdout = old_stdout
|
79
|
-
sys.stderr = old_stderr
|
88
|
+
# Write all of this information to a crash file
|
89
|
+
with open(os.path.join(folder, 'crash.txt'), 'w') as f:
|
90
|
+
f.write(str(e))
|
91
|
+
f.write("\n")
|
92
|
+
traceback.print_exc(file=f)
|
93
|
+
finally:
|
94
|
+
stdout_thread.join()
|
95
|
+
stderr_thread.join()
|
96
|
+
|
97
|
+
sys.stdout = old_stdout
|
98
|
+
sys.stderr = old_stderr
|
80
99
|
|
81
100
|
def process_list(data, parameter_map, args, options, oh_strategy, config, metainfo, list_name):
|
82
101
|
"""_summary_
|
File without changes
|
File without changes
|
File without changes
|