mg-pso-gui 0.1.50__tar.gz → 0.1.52__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.50 → mg-pso-gui-0.1.52}/PKG-INFO +1 -1
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mg_pso_gui.egg-info/PKG-INFO +1 -1
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/HomePage.py +5 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/VisualizeTab/SideBar.py +74 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/VisualizeTab/VisualizeTab.py +1 -1
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/util/GraphGenerator.py +80 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/setup.py +1 -1
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mg_pso_gui.egg-info/SOURCES.txt +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mg_pso_gui.egg-info/dependency_links.txt +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mg_pso_gui.egg-info/entry_points.txt +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mg_pso_gui.egg-info/requires.txt +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mg_pso_gui.egg-info/top_level.txt +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/__init__.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/OptionManager.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/PlatformTab/PlatformTab.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/PlatformTab/__init__.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/RunTab/RunTab.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/RunTab/__init__.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/SetupTab/BoundsEditorWindow.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/SetupTab/BoundsList.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/SetupTab/CalibrationParametersView.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/SetupTab/FunctionsList.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/SetupTab/ListParametersView.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/SetupTab/SetupTab.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/SetupTab/StaticParameterView.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/SetupTab/StepView.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/SetupTab/__init__.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/VisualizeTab/__init__.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/__init__.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/images/IGOW 4 Logo.png +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/images/collapse.png +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/images/down.png +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/images/expand.png +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/images/play.png +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/images/refresh.png +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/images/refresh_hd.png +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/images/stop.png +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/images/test.png +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/images/trash.png +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/gui/images/up.png +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/mgpsogui.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/start.yaml +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/util/CTkToolTip/__init__.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/util/CTkToolTip/ctk_tooltip.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/util/PSORunner.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/util/__init__.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/util/recosu/__init__.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/util/recosu/pso/__init__.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/util/recosu/pso/csip_access.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/util/recosu/pso/pso.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/util/recosu/utils/__init__.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/util/recosu/utils/plot/__init__.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/util/recosu/utils/plot/cost_steps.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/util/recosu/utils/trace_writer.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/mgpsogui/util/recosu/utils/utils.py +0 -0
- {mg-pso-gui-0.1.50 → mg-pso-gui-0.1.52}/setup.cfg +0 -0
|
@@ -69,6 +69,11 @@ class App(customtkinter.CTk):
|
|
|
69
69
|
self.selected_csv.set("No files found...")
|
|
70
70
|
self.open_file = "None"
|
|
71
71
|
self.csv_data = None
|
|
72
|
+
|
|
73
|
+
self.selected_csv2 = tk.StringVar()
|
|
74
|
+
self.selected_csv2.set("No files found...")
|
|
75
|
+
self.open_file2 = "None"
|
|
76
|
+
self.csv_data2 = None
|
|
72
77
|
|
|
73
78
|
self.selected_x = tk.StringVar()
|
|
74
79
|
self.selected_x.set("time")
|
|
@@ -116,5 +116,79 @@ class SideBar(CTkScrollableFrame):
|
|
|
116
116
|
self.home_page.csv_y2_selector = CTkOptionMenu(self.containerFrame, values=columns, variable=self.home_page.selected_y2, command=self.home_page.update_graph)
|
|
117
117
|
self.home_page.csv_y2_selector.grid(row=7, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
|
|
118
118
|
|
|
119
|
+
if (self.home_page.csv_y2_selector.get() not in columns):
|
|
120
|
+
self.home_page.csv_y2_selector.set(columns[3])
|
|
121
|
+
|
|
122
|
+
elif (selected_graph == "Compare CSV"):
|
|
123
|
+
info = self.option_manager.get_project_data()
|
|
124
|
+
folder = os.path.join(info['path'], info['name'])
|
|
125
|
+
if not os.path.exists(folder):
|
|
126
|
+
os.makedirs(folder)
|
|
127
|
+
|
|
128
|
+
# Get all CSV files in the folder and add their paths to a list
|
|
129
|
+
path_map = {}
|
|
130
|
+
name_list = []
|
|
131
|
+
for root, dirs, files in os.walk(folder):
|
|
132
|
+
for file in files:
|
|
133
|
+
if file.endswith(".csv"):
|
|
134
|
+
name = file.replace(".csv", "")
|
|
135
|
+
name_list.append(name)
|
|
136
|
+
path_map[name] = os.path.join(root, file)
|
|
137
|
+
|
|
138
|
+
if (len(name_list) == 0):
|
|
139
|
+
name_list.append("No files found...")
|
|
140
|
+
else:
|
|
141
|
+
if (self.home_page.selected_csv.get() not in name_list):
|
|
142
|
+
self.home_page.selected_csv.set(name_list[0])
|
|
143
|
+
if (self.home_page.selected_csv2.get() not in name_list):
|
|
144
|
+
self.home_page.selected_csv2.set(name_list[0])
|
|
145
|
+
|
|
146
|
+
file_label = CTkLabel(self.containerFrame, text="CSV Files:")
|
|
147
|
+
file_label.grid(row=0, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
|
|
148
|
+
|
|
149
|
+
self.home_page.csv_file_selector = CTkOptionMenu(self.containerFrame, values=name_list, variable=self.home_page.selected_csv, command=self.home_page.update_graph)
|
|
150
|
+
self.home_page.csv_file_selector.grid(row=1, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
|
|
151
|
+
|
|
152
|
+
self.home_page.csv_file_selector2 = CTkOptionMenu(self.containerFrame, values=name_list, variable=self.home_page.selected_csv2, command=self.home_page.update_graph)
|
|
153
|
+
self.home_page.csv_file_selector2.grid(row=2, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
|
|
154
|
+
|
|
155
|
+
selected_file = self.home_page.selected_csv.get()
|
|
156
|
+
if (selected_file in path_map and selected_file != self.home_page.open_file):
|
|
157
|
+
self.home_page.csv_data = pd.read_csv(path_map[selected_file], skiprows=3)
|
|
158
|
+
self.home_page.open_file = selected_file
|
|
159
|
+
|
|
160
|
+
selected_file2 = self.home_page.selected_csv2.get()
|
|
161
|
+
if (selected_file2 in path_map and selected_file2 != self.home_page.open_file2):
|
|
162
|
+
self.home_page.csv_data2 = pd.read_csv(path_map[selected_file2], skiprows=3)
|
|
163
|
+
self.home_page.open_file2 = selected_file2
|
|
164
|
+
|
|
165
|
+
if (self.home_page.csv_data is not None and self.home_page.csv_data2 is not None):
|
|
166
|
+
# Get all column names of CSV
|
|
167
|
+
columns = self.home_page.csv_data.columns
|
|
168
|
+
|
|
169
|
+
x_axis_label = CTkLabel(self.containerFrame, text="X Axis:")
|
|
170
|
+
x_axis_label.grid(row=3, column=0, padx=(20, 20), pady=(40, 5), sticky="w")
|
|
171
|
+
|
|
172
|
+
self.home_page.csv_x_selector = CTkOptionMenu(self.containerFrame, values=columns, variable=self.home_page.selected_x, command=self.home_page.update_graph)
|
|
173
|
+
self.home_page.csv_x_selector.grid(row=4, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
|
|
174
|
+
|
|
175
|
+
if (self.home_page.csv_x_selector.get() not in columns):
|
|
176
|
+
self.home_page.csv_x_selector.set(columns[1])
|
|
177
|
+
|
|
178
|
+
y1_axis_label = CTkLabel(self.containerFrame, text="Y Axis:")
|
|
179
|
+
y1_axis_label.grid(row=5, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
|
|
180
|
+
|
|
181
|
+
self.home_page.csv_y1_selector = CTkOptionMenu(self.containerFrame, values=columns, variable=self.home_page.selected_y1, command=self.home_page.update_graph)
|
|
182
|
+
self.home_page.csv_y1_selector.grid(row=6, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
|
|
183
|
+
|
|
184
|
+
if (self.home_page.csv_y1_selector.get() not in columns):
|
|
185
|
+
self.home_page.csv_y1_selector.set(columns[2])
|
|
186
|
+
|
|
187
|
+
y2_axis_label = CTkLabel(self.containerFrame, text="Secondary Y Axis:")
|
|
188
|
+
y2_axis_label.grid(row=7, column=0, padx=(20, 20), pady=(20, 5), sticky="w")
|
|
189
|
+
|
|
190
|
+
self.home_page.csv_y2_selector = CTkOptionMenu(self.containerFrame, values=columns, variable=self.home_page.selected_y2, command=self.home_page.update_graph)
|
|
191
|
+
self.home_page.csv_y2_selector.grid(row=8, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
|
|
192
|
+
|
|
119
193
|
if (self.home_page.csv_y2_selector.get() not in columns):
|
|
120
194
|
self.home_page.csv_y2_selector.set(columns[3])
|
|
@@ -61,7 +61,7 @@ def create_tab(self, tab):
|
|
|
61
61
|
self.graph_container.grid_columnconfigure(0, weight=1)
|
|
62
62
|
self.graph_container.grid_rowconfigure(0, weight=1)
|
|
63
63
|
|
|
64
|
-
self.graph_selector = customtkinter.CTkOptionMenu(self.graph_sidebar, values=["Best Cost Stacked", "Best Cost by Round", "Calibrated Parameters", "Iteration Table", "Custom CSV"], variable=self.graph_selector_value, command=self.update_graph)
|
|
64
|
+
self.graph_selector = customtkinter.CTkOptionMenu(self.graph_sidebar, values=["Best Cost Stacked", "Best Cost by Round", "Calibrated Parameters", "Iteration Table", "Custom CSV", "Compare CSV"], variable=self.graph_selector_value, command=self.update_graph)
|
|
65
65
|
self.graph_selector.grid(row=0, column=0, padx=(20, 20), pady=(20, 20), sticky="nsew")
|
|
66
66
|
|
|
67
67
|
# Create SideBar
|
|
@@ -29,6 +29,9 @@ def generate_graphs(HomePage):
|
|
|
29
29
|
elif (selected_graph == "Custom CSV"):
|
|
30
30
|
HomePage.selected_graph_name = "custom_csv"
|
|
31
31
|
custom_csv(HomePage, HomePage.option_manager)
|
|
32
|
+
elif (selected_graph == "Compare CSV"):
|
|
33
|
+
HomePage.selected_graph_name = "compare_csv"
|
|
34
|
+
compare_csv(HomePage, HomePage.option_manager)
|
|
32
35
|
|
|
33
36
|
image_path = os.path.join(folder, HomePage.selected_graph_name + ".png")
|
|
34
37
|
|
|
@@ -344,3 +347,80 @@ def custom_csv(homepage, option_manager):
|
|
|
344
347
|
f.write(html)
|
|
345
348
|
|
|
346
349
|
return fig
|
|
350
|
+
|
|
351
|
+
def compare_csv(homepage, option_manager):
|
|
352
|
+
fig = go.Figure()
|
|
353
|
+
|
|
354
|
+
data = homepage.csv_data
|
|
355
|
+
data2 = homepage.csv_data2
|
|
356
|
+
|
|
357
|
+
x = homepage.csv_x_selector.get()
|
|
358
|
+
val = homepage.csv_y1_selector.get()
|
|
359
|
+
val2 = homepage.csv_y2_selector.get()
|
|
360
|
+
|
|
361
|
+
xx = None
|
|
362
|
+
if x == "time":
|
|
363
|
+
xx = pd.to_datetime(data["time"], format='%Y-%m-%d', errors='coerce').iloc[2:]
|
|
364
|
+
else:
|
|
365
|
+
xx = pd.to_numeric(data[x], errors="coerce").iloc[2:]
|
|
366
|
+
|
|
367
|
+
yy = pd.to_numeric(data[val], errors="coerce").iloc[2:]
|
|
368
|
+
|
|
369
|
+
xx2 = None
|
|
370
|
+
if x == "time":
|
|
371
|
+
xx2 = pd.to_datetime(data2["time"], format='%Y-%m-%d', errors='coerce').iloc[2:]
|
|
372
|
+
else:
|
|
373
|
+
xx2 = pd.to_numeric(data2[x], errors="coerce").iloc[2:]
|
|
374
|
+
|
|
375
|
+
yy = pd.to_numeric(data[val], errors="coerce").iloc[2:]
|
|
376
|
+
|
|
377
|
+
#yy_unit = "N/A"
|
|
378
|
+
yy_unit = data[val].iloc[1]
|
|
379
|
+
|
|
380
|
+
yy2 = pd.to_numeric(data2[val2], errors="coerce").iloc[2:]
|
|
381
|
+
|
|
382
|
+
#yy2_unit = "N/A"
|
|
383
|
+
yy2_unit = data2[val2].iloc[1]
|
|
384
|
+
|
|
385
|
+
fig.add_trace(go.Scatter(x=xx, y=yy, name=val))
|
|
386
|
+
fig.add_trace(go.Scatter(x=xx2, y=yy2, name=val2, yaxis='y2'))
|
|
387
|
+
|
|
388
|
+
fig.update_layout(
|
|
389
|
+
title="",
|
|
390
|
+
xaxis_title=x,
|
|
391
|
+
yaxis_title=val,
|
|
392
|
+
font=dict(color='white'),
|
|
393
|
+
paper_bgcolor='rgba(42, 42, 42, 0)',
|
|
394
|
+
plot_bgcolor='rgb(62, 62, 62)',
|
|
395
|
+
xaxis=dict(
|
|
396
|
+
gridcolor='rgb(72, 72, 72)',
|
|
397
|
+
gridwidth=1
|
|
398
|
+
),
|
|
399
|
+
yaxis=dict(
|
|
400
|
+
title=val + " (" + str(yy_unit) + ")",
|
|
401
|
+
autorange=True,
|
|
402
|
+
gridcolor='rgb(72, 72, 72)',
|
|
403
|
+
gridwidth=0.1
|
|
404
|
+
),
|
|
405
|
+
yaxis2=dict(
|
|
406
|
+
title=val2 + " (" + str(yy2_unit) + ")",
|
|
407
|
+
overlaying='y',
|
|
408
|
+
side='right'
|
|
409
|
+
)
|
|
410
|
+
)
|
|
411
|
+
|
|
412
|
+
info = option_manager.get_project_data()
|
|
413
|
+
folder = os.path.join(info['path'], info['name'])
|
|
414
|
+
|
|
415
|
+
if not os.path.exists(folder):
|
|
416
|
+
os.makedirs(folder)
|
|
417
|
+
|
|
418
|
+
fig.write_image(os.path.join(folder, "compare_csv.png"), width=1280, height=720)
|
|
419
|
+
fig.write_html(os.path.join(folder, "compare_csv.html"), include_plotlyjs='cdn', auto_open=False)
|
|
420
|
+
with open(os.path.join(folder, "compare_csv.html"), "r") as f:
|
|
421
|
+
html = f.read()
|
|
422
|
+
html = html.replace("<body>", "<body bgcolor='#2a2a2a'>")
|
|
423
|
+
with open(os.path.join(folder, "compare_csv.html"), "w") as f:
|
|
424
|
+
f.write(html)
|
|
425
|
+
|
|
426
|
+
return fig
|
|
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
|