mg-pso-gui 0.1.20__tar.gz → 0.1.22__tar.gz
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.20 → mg-pso-gui-0.1.22}/PKG-INFO +1 -1
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mg_pso_gui.egg-info/PKG-INFO +1 -1
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/HomePage.py +33 -23
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/RunTab/RunTab.py +1 -20
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/util/GraphGenerator.py +27 -2
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/setup.py +1 -1
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mg_pso_gui.egg-info/SOURCES.txt +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mg_pso_gui.egg-info/dependency_links.txt +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mg_pso_gui.egg-info/entry_points.txt +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mg_pso_gui.egg-info/requires.txt +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mg_pso_gui.egg-info/top_level.txt +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/__init__.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/OptionManager.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/PlatformTab/PlatformTab.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/PlatformTab/__init__.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/RunTab/__init__.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/SetupTab/BoundsEditorWindow.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/SetupTab/BoundsList.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/SetupTab/CalibrationParametersView.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/SetupTab/FunctionsList.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/SetupTab/ListParametersView.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/SetupTab/SetupTab.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/SetupTab/StaticParameterView.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/SetupTab/StepView.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/SetupTab/__init__.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/VisualizeTab/VisualizeTab.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/VisualizeTab/__init__.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/__init__.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/images/IGOW 4 Logo.png +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/images/collapse.png +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/images/down.png +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/images/expand.png +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/images/play.png +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/images/refresh.png +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/images/refresh_hd.png +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/images/stop.png +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/images/test.png +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/images/trash.png +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/gui/images/up.png +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/mgpsogui.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/start.yaml +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/util/CTkToolTip/__init__.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/util/CTkToolTip/ctk_tooltip.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/util/PSORunner.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/util/__init__.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/util/recosu/__init__.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/util/recosu/pso/__init__.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/util/recosu/pso/csip_access.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/util/recosu/pso/pso.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/util/recosu/utils/__init__.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/util/recosu/utils/plot/__init__.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/util/recosu/utils/plot/cost_steps.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/util/recosu/utils/trace_writer.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/mgpsogui/util/recosu/utils/utils.py +0 -0
- {mg-pso-gui-0.1.20 → mg-pso-gui-0.1.22}/setup.cfg +0 -0
|
@@ -175,6 +175,8 @@ class App(customtkinter.CTk):
|
|
|
175
175
|
ctt(self.download_button, delay=0.1, alpha=0.95, message="Download Results")
|
|
176
176
|
self.download_button.grid(row=0, column=10, padx=(5, 20), pady=header_padding_y)
|
|
177
177
|
|
|
178
|
+
self.after(1000, self.running_loop)
|
|
179
|
+
|
|
178
180
|
'''def _resize_image(self, event):
|
|
179
181
|
self.graph_label.update_idletasks()
|
|
180
182
|
new_width = self.graph_label.winfo_width()
|
|
@@ -267,13 +269,15 @@ class App(customtkinter.CTk):
|
|
|
267
269
|
if "service_parameters" in metrics:
|
|
268
270
|
self.option_manager.set_service_parameters(metrics["service_parameters"])
|
|
269
271
|
self.tabview.configure(state="enabled")
|
|
270
|
-
|
|
272
|
+
|
|
271
273
|
if "calibration_progress" in metrics:
|
|
272
274
|
self.progress_data = pd.read_json(metrics["calibration_progress"])
|
|
273
275
|
self.calibration_data = metrics["calibration_data"]
|
|
274
|
-
|
|
276
|
+
print(self.progress_data)
|
|
277
|
+
|
|
275
278
|
if "calibration_data" in metrics:
|
|
276
279
|
self.calibration_data = metrics["calibration_data"]
|
|
280
|
+
print(self.calibration_data)
|
|
277
281
|
|
|
278
282
|
print(metrics)
|
|
279
283
|
|
|
@@ -347,6 +351,9 @@ class App(customtkinter.CTk):
|
|
|
347
351
|
metrics = self.option_manager.get_metrics()
|
|
348
352
|
self.running_config = metrics
|
|
349
353
|
|
|
354
|
+
self.progress_data = None
|
|
355
|
+
self.calibration_data = None
|
|
356
|
+
|
|
350
357
|
#self.progress_bar.configure(mode="indeterminnate")
|
|
351
358
|
#self.progress_bar.start()
|
|
352
359
|
self.footer_progress_bar.configure(mode="indeterminnate")
|
|
@@ -364,6 +371,15 @@ class App(customtkinter.CTk):
|
|
|
364
371
|
try:
|
|
365
372
|
info = self.option_manager.get_project_data()
|
|
366
373
|
folder = os.path.join(info['path'], info['name'])
|
|
374
|
+
|
|
375
|
+
if not os.path.exists(folder):
|
|
376
|
+
os.makedirs(folder)
|
|
377
|
+
|
|
378
|
+
if (os.path.exists(os.path.join(folder, 'output.txt'))):
|
|
379
|
+
os.remove(os.path.join(folder, 'output.txt'))
|
|
380
|
+
|
|
381
|
+
if (os.path.exists(os.path.join(folder, 'error.txt'))):
|
|
382
|
+
os.remove(os.path.join(folder, 'error.txt'))
|
|
367
383
|
|
|
368
384
|
self.train_process = Process(target=PSORunner.run_process, args=(stdout_queue, stderr_queue, results_queue, cosu_queue, metrics, folder))
|
|
369
385
|
self.train_process.daemon = True
|
|
@@ -418,9 +434,18 @@ class App(customtkinter.CTk):
|
|
|
418
434
|
self.footer_progress_label.configure(text="Stopped")
|
|
419
435
|
self.progress_message_right.configure(text="")
|
|
420
436
|
|
|
437
|
+
def running_loop(self):
|
|
438
|
+
try:
|
|
439
|
+
active_tab = self.tabview.get()
|
|
440
|
+
if (active_tab == "Results"):
|
|
441
|
+
GraphGenerator.generate_graphs(self)
|
|
442
|
+
else:
|
|
443
|
+
print(active_tab)
|
|
444
|
+
finally:
|
|
445
|
+
self.after(1000, self.running_loop)
|
|
446
|
+
|
|
421
447
|
def watch_loop(self):
|
|
422
448
|
# Check if file exists:
|
|
423
|
-
|
|
424
449
|
info = self.option_manager.get_project_data()
|
|
425
450
|
folder = os.path.join(info['path'], info['name'])
|
|
426
451
|
|
|
@@ -492,11 +517,11 @@ class App(customtkinter.CTk):
|
|
|
492
517
|
progress_values = [tuple(map(float, i)) for i in progress_values]
|
|
493
518
|
|
|
494
519
|
#print("Current params: " + str(calibrated_params), flush=True)
|
|
495
|
-
|
|
520
|
+
|
|
496
521
|
self.calibration_data = calibrated_params
|
|
497
522
|
|
|
498
523
|
#GraphGenerator.calibrated_params_by_round(self.running_config['steps'], calibrated_params, self.option_manager)
|
|
499
|
-
self.update_graph("")
|
|
524
|
+
#self.update_graph("")
|
|
500
525
|
except Exception as e:
|
|
501
526
|
# Print stack trace
|
|
502
527
|
traceback.print_exc()
|
|
@@ -523,12 +548,6 @@ class App(customtkinter.CTk):
|
|
|
523
548
|
df = df.drop_duplicates(subset=['completed_rounds', 'round_step'])
|
|
524
549
|
self.progress_data = df
|
|
525
550
|
|
|
526
|
-
#GraphGenerator.update_progress_graphs(self.running_config['steps'], self.current_data, self.option_manager)
|
|
527
|
-
#GraphGenerator.best_cost_stacked(self.running_config['steps'], df, self.option_manager)
|
|
528
|
-
#GraphGenerator.best_cost_by_round(self.running_config['steps'], df, self.option_manager)
|
|
529
|
-
#GraphGenerator.table(self.running_config['steps'], df, self.option_manager)
|
|
530
|
-
#self.update_graph("")
|
|
531
|
-
|
|
532
551
|
match = matches[-1]
|
|
533
552
|
percent = int(match[0])
|
|
534
553
|
completed_rounds = int(match[1])
|
|
@@ -561,18 +580,6 @@ class App(customtkinter.CTk):
|
|
|
561
580
|
if self.train_process.is_alive():
|
|
562
581
|
self.after(1000, self.watch_loop)
|
|
563
582
|
else:
|
|
564
|
-
# Check if queue is empty
|
|
565
|
-
"""
|
|
566
|
-
if (self.process_queue.empty()):
|
|
567
|
-
print("PROCESS FINISHED BUT WE GOT NO OBJECTS :(")
|
|
568
|
-
self.footer_progress_label.configure(text="Failed")
|
|
569
|
-
else:
|
|
570
|
-
self.final_results = self.process_queue.get()
|
|
571
|
-
print("PROCESS FINISHED WE GOT THINGS")
|
|
572
|
-
print(self.final_results)
|
|
573
|
-
self.footer_progress_label.configure(text="Finished")
|
|
574
|
-
"""
|
|
575
|
-
|
|
576
583
|
#self.progress_bar.stop()
|
|
577
584
|
self.footer_progress_bar.stop()
|
|
578
585
|
#self.progress_bar.configure(mode="indeterminate")
|
|
@@ -584,6 +591,9 @@ class App(customtkinter.CTk):
|
|
|
584
591
|
self.progress_message_right.configure(text="")
|
|
585
592
|
self.textbox.insert("0.0", "\nCalibration finished!\n")
|
|
586
593
|
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
|
|
587
597
|
def start():
|
|
588
598
|
app = App()
|
|
589
599
|
app.mainloop()
|
|
@@ -19,21 +19,7 @@ def create_tab(self, tab):
|
|
|
19
19
|
tab.grid_columnconfigure(0, weight=1)
|
|
20
20
|
tab.grid_rowconfigure(0, weight=1)
|
|
21
21
|
tab.grid_rowconfigure(1, weight=200)
|
|
22
|
-
|
|
23
|
-
"""
|
|
24
|
-
self.url = customtkinter.CTkEntry(tab, textvariable=self.option_manager.get_arguments()['url'])
|
|
25
|
-
self.url.grid(row=0, column=0, columnspan=1, padx=(20, 20), pady=(20, 20), sticky="nsew")
|
|
26
22
|
|
|
27
|
-
self.run_button = customtkinter.CTkButton(tab, text="Run", command=self.run)
|
|
28
|
-
self.run_button.grid(row=0, column=1, padx=(20, 20), pady=(20, 20), sticky="nsew")
|
|
29
|
-
ctt(self.run_button, delay=0.5, message="Start calibration...")
|
|
30
|
-
|
|
31
|
-
self.stop_button = customtkinter.CTkButton(tab, text="Stop", command=self.stop)
|
|
32
|
-
self.stop_button.grid(row=0, column=2, padx=(20, 20), pady=(20, 20), sticky="nsew")
|
|
33
|
-
ctt(self.stop_button, delay=0.5, message="Stop calibration...")
|
|
34
|
-
|
|
35
|
-
"""
|
|
36
|
-
|
|
37
23
|
self.progress_container = customtkinter.CTkFrame(tab)
|
|
38
24
|
self.progress_container.grid_columnconfigure(0, weight=1)
|
|
39
25
|
self.progress_container.grid_columnconfigure(1, weight=1)
|
|
@@ -50,12 +36,7 @@ def create_tab(self, tab):
|
|
|
50
36
|
self.progress_message_right = customtkinter.CTkLabel(self.progress_container, text="")
|
|
51
37
|
self.progress_message_right.grid(row=0, column=2, padx=(10, 10), pady=(10, 10), sticky="e")
|
|
52
38
|
|
|
53
|
-
#self.progress_bar = customtkinter.CTkProgressBar(self.progress_container)
|
|
54
|
-
#self.progress_bar.grid(row=1, column=0, columnspan=3, padx=(10, 10), pady=(10, 10), sticky="ew")
|
|
55
|
-
#self.progress_bar.set(0)
|
|
56
|
-
#ctt(self.progress_bar, delay=0.5, message="Current calibration progress")
|
|
57
|
-
|
|
58
39
|
self.textbox = customtkinter.CTkTextbox(tab)
|
|
59
40
|
self.textbox.grid(row=1, column=0, padx=(20, 20), pady=(20, 20), sticky="nsew")
|
|
60
|
-
self.textbox.insert("0.0", "Welcome to the CSIP PSO Calibration Tool!\n\nUse the
|
|
41
|
+
self.textbox.insert("0.0", "Welcome to the CSIP PSO Calibration Tool!\n\nUse the Setup tab to define steps and calibration parameters. Use this tab to view logs and observe calibration progress. Once finished, use the Results tab to generate figures and graphs.")
|
|
61
42
|
|
|
@@ -3,9 +3,34 @@ import plotly.graph_objs as go
|
|
|
3
3
|
import pandas as pd
|
|
4
4
|
import numpy as np
|
|
5
5
|
import os
|
|
6
|
+
from PIL import Image, ImageTk
|
|
6
7
|
|
|
7
|
-
def generate_graphs(
|
|
8
|
-
|
|
8
|
+
def generate_graphs(HomePage):
|
|
9
|
+
selected_graph = HomePage.graph_selector_value.get()
|
|
10
|
+
info = HomePage.option_manager.get_project_data()
|
|
11
|
+
folder = os.path.join(info['path'], info['name'])
|
|
12
|
+
if not os.path.exists(folder):
|
|
13
|
+
os.makedirs(folder)
|
|
14
|
+
|
|
15
|
+
if (selected_graph == "Best Cost Stacked"):
|
|
16
|
+
HomePage.selected_graph_name = "best_cost_stacked"
|
|
17
|
+
best_cost_stacked(HomePage.running_config['steps'], HomePage.progress_data, HomePage.option_manager)
|
|
18
|
+
elif (selected_graph == "Best Cost by Round"):
|
|
19
|
+
HomePage.selected_graph_name = "best_cost_by_round"
|
|
20
|
+
best_cost_by_round(HomePage.running_config['steps'], HomePage.progress_data, HomePage.option_manager)
|
|
21
|
+
elif (selected_graph == "Iteration Table"):
|
|
22
|
+
HomePage.selected_graph_name = "table"
|
|
23
|
+
table(HomePage.running_config['steps'], HomePage.progress_data, HomePage.option_manager)
|
|
24
|
+
elif (selected_graph == "Calibrated Parameters"):
|
|
25
|
+
HomePage.selected_graph_name = "calibrated_params_by_round"
|
|
26
|
+
calibrated_params_by_round(HomePage.running_config['steps'], HomePage.calibration_data, HomePage.option_manager)
|
|
27
|
+
|
|
28
|
+
image_path = os.path.join(folder, HomePage.selected_graph_name + ".png")
|
|
29
|
+
|
|
30
|
+
if not os.path.exists(image_path):
|
|
31
|
+
image_path = os.path.join("./images", "up.png")
|
|
32
|
+
|
|
33
|
+
HomePage.graph_image_obj = Image.open(image_path)
|
|
9
34
|
|
|
10
35
|
def best_cost_stacked(config, dataframe, option_manager):
|
|
11
36
|
fig = go.Figure()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|