mg-pso-gui 0.1.176__py3-none-any.whl → 0.1.178__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.176.dist-info → mg_pso_gui-0.1.178.dist-info}/METADATA +1 -1
- {mg_pso_gui-0.1.176.dist-info → mg_pso_gui-0.1.178.dist-info}/RECORD +7 -7
- mgpsogui/gui/VisualizeTab/SideBar.py +1 -1
- mgpsogui/util/GraphGenerator.py +141 -0
- {mg_pso_gui-0.1.176.dist-info → mg_pso_gui-0.1.178.dist-info}/WHEEL +0 -0
- {mg_pso_gui-0.1.176.dist-info → mg_pso_gui-0.1.178.dist-info}/entry_points.txt +0 -0
- {mg_pso_gui-0.1.176.dist-info → mg_pso_gui-0.1.178.dist-info}/top_level.txt +0 -0
@@ -19,7 +19,7 @@ mgpsogui/gui/SetupTab/StaticParameterView.py,sha256=iEG-UpBBlAJabZo3MG768oLqOROj
|
|
19
19
|
mgpsogui/gui/SetupTab/StepView.py,sha256=_gdfiYr_GqqbQfSYLvdllIYCHdGsy1339cALfYLDAEQ,5909
|
20
20
|
mgpsogui/gui/SetupTab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
21
21
|
mgpsogui/gui/VisualizeTab/MatrixEditor.py,sha256=-nwVw4FizlbVZdnM7r8-bexowF_qUtoeQ0Mu0mZijFQ,2851
|
22
|
-
mgpsogui/gui/VisualizeTab/SideBar.py,sha256=
|
22
|
+
mgpsogui/gui/VisualizeTab/SideBar.py,sha256=342SridpIqL6LBRE2rDAoUQqbMYCBCiSL3xNo3iPzz8,21936
|
23
23
|
mgpsogui/gui/VisualizeTab/VisualizeTab.py,sha256=_SiRDUvYJ7VUmMZ_VzylWP2tFygbLzWeUCGW3TU3yZM,3466
|
24
24
|
mgpsogui/gui/VisualizeTab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
25
25
|
mgpsogui/gui/images/IGOW 4 Logo.png,sha256=JixNXz5gOEj898VF-_PHthAlGU-6W-y9ucb4EVNPtjs,433752
|
@@ -33,7 +33,7 @@ mgpsogui/gui/images/stop.png,sha256=JPuxXQerCGpLikcp7cAj3iLCOjULMYYZ2sZe0lArh68,
|
|
33
33
|
mgpsogui/gui/images/test.png,sha256=MUnVpRK-isxhEHzx4Q6Yh0M6FRZD1qvgCHH2XmiSBbk,3642
|
34
34
|
mgpsogui/gui/images/trash.png,sha256=j8cf0kWbJd-4Jp20lUVV1o1NSeQ4v1Ej4gfcIA3DVRQ,2958
|
35
35
|
mgpsogui/gui/images/up.png,sha256=AQvFWCUqSQNaQ1E6LKZ9zNfSvW6t4mgy8uswdg9T2Hg,2457
|
36
|
-
mgpsogui/util/GraphGenerator.py,sha256=
|
36
|
+
mgpsogui/util/GraphGenerator.py,sha256=OyCPwIDkbRzNZiJQII3F76yTKj_EdeMiE8vaih-n5lE,22811
|
37
37
|
mgpsogui/util/PSORunner.py,sha256=sWgickFGl97p3ybWz97LR5qeYhnNqryKx5nWAa-NhwA,6306
|
38
38
|
mgpsogui/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
39
39
|
mgpsogui/util/debug.py,sha256=Swzny9_1S-CCONWGssj9iDoSpbwu5Vr4f95g_9L8bec,19759
|
@@ -59,8 +59,8 @@ mgpsogui/util/recosu/utils/trace_writer.py,sha256=V9BJlOjCbNYGoXGEk3CF5wjifBxvar
|
|
59
59
|
mgpsogui/util/recosu/utils/utils.py,sha256=QB8vftq3142ekG0ORjz0ZBHU5YknXbR0oTsrxrPAsF0,3951
|
60
60
|
mgpsogui/util/recosu/utils/plot/__init__.py,sha256=h1KjM7_tNDv351pcwt8A6Ibb1jhwWyx5Gbu-zj-sI3Q,71
|
61
61
|
mgpsogui/util/recosu/utils/plot/cost_steps.py,sha256=1Ce11AJyweWkmvjXPxEygzS-h8yVLmQEDLS53yjPLqQ,3779
|
62
|
-
mg_pso_gui-0.1.
|
63
|
-
mg_pso_gui-0.1.
|
64
|
-
mg_pso_gui-0.1.
|
65
|
-
mg_pso_gui-0.1.
|
66
|
-
mg_pso_gui-0.1.
|
62
|
+
mg_pso_gui-0.1.178.dist-info/METADATA,sha256=HSLGeRWZJgFvQtiZkncX4wzYtlUOE7gv9q9pjzO1NaU,9456
|
63
|
+
mg_pso_gui-0.1.178.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
64
|
+
mg_pso_gui-0.1.178.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
|
65
|
+
mg_pso_gui-0.1.178.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
|
66
|
+
mg_pso_gui-0.1.178.dist-info/RECORD,,
|
@@ -327,7 +327,7 @@ class SideBar(CTkScrollableFrame):
|
|
327
327
|
self.home_page.csv_x_selector.set(columns[1])
|
328
328
|
|
329
329
|
self.matrix_editor = me.MatrixEditor(self.containerFrame, option_manager=self.option_manager, home_page=self.home_page, columns=columns)
|
330
|
-
self.matrix_editor.grid(row=6, column=0, padx=(10, 10), pady=(10, 0), sticky="nsew")
|
330
|
+
self.matrix_editor.grid(row=6, rowspan=3, column=0, padx=(10, 10), pady=(10, 0), sticky="nsew")
|
331
331
|
self.matrix_editor.grid_columnconfigure(0, weight=1)
|
332
332
|
self.matrix_editor.grid_rowconfigure(0, weight=1)
|
333
333
|
|
mgpsogui/util/GraphGenerator.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import plotly.express as px
|
2
2
|
import plotly.graph_objs as go
|
3
|
+
from plotly.subplots import make_subplots
|
3
4
|
import pandas as pd
|
4
5
|
import numpy as np
|
5
6
|
import os
|
@@ -38,6 +39,7 @@ def generate_graphs(HomePage):
|
|
38
39
|
sampling_csv(HomePage, HomePage.option_manager)
|
39
40
|
elif (selected_graph == "Matrix Editor"):
|
40
41
|
HomePage.selected_graph_name = "matrix_editor"
|
42
|
+
matrix_editor(HomePage, HomePage.option_manager)
|
41
43
|
pass
|
42
44
|
|
43
45
|
image_path = os.path.join(folder, HomePage.selected_graph_name + ".png")
|
@@ -525,4 +527,143 @@ def sampling_csv(homepage, option_manager):
|
|
525
527
|
with open(os.path.join(folder, "sampling_csv.html"), "w") as f:
|
526
528
|
f.write(html)
|
527
529
|
|
530
|
+
return fig
|
531
|
+
|
532
|
+
def matrix_editor(homepage, option_manager):
|
533
|
+
style = homepage.figure_style.get()
|
534
|
+
data = homepage.csv_data
|
535
|
+
x = homepage.csv_x_selector.get()
|
536
|
+
|
537
|
+
all_figures = []
|
538
|
+
figure_parameters = option_manager.get_arguments()['figure_parameters']
|
539
|
+
|
540
|
+
color_list = ['#636EFA', '#EF553B', '#00CC96', '#AB63FA', '#FFA15A', '#19D3F3', '#FF6692', '#B6E880', '#FF97FF', '#FECB52']
|
541
|
+
color_index = 0
|
542
|
+
color_dict = {}
|
543
|
+
|
544
|
+
total_figures = 0
|
545
|
+
for parameter in figure_parameters:
|
546
|
+
name = parameter['name'].get()
|
547
|
+
if ("Fig" not in name):
|
548
|
+
continue
|
549
|
+
total_figures += 1
|
550
|
+
|
551
|
+
figures_per_row = 1
|
552
|
+
if (total_figures == 1):
|
553
|
+
figures_per_row = 1
|
554
|
+
elif (total_figures == 2):
|
555
|
+
figures_per_row = 2
|
556
|
+
elif (total_figures == 3 or total_figures == 4):
|
557
|
+
figures_per_row = 2
|
558
|
+
elif (total_figures == 5 or total_figures == 6):
|
559
|
+
figures_per_row = 3
|
560
|
+
elif (total_figures == 7 or total_figures == 8):
|
561
|
+
figures_per_row = 4
|
562
|
+
elif (total_figures == 9 or total_figures == 10):
|
563
|
+
figures_per_row = 5
|
564
|
+
|
565
|
+
fig_combined = make_subplots(rows=(total_figures // figures_per_row) + 1, cols=figures_per_row, shared_xaxes=False, shared_yaxes=False)
|
566
|
+
|
567
|
+
for parameter in figure_parameters:
|
568
|
+
name = parameter['name'].get()
|
569
|
+
|
570
|
+
if ("Fig" not in name):
|
571
|
+
continue
|
572
|
+
|
573
|
+
fig = go.Figure()
|
574
|
+
val = parameter['value'].get()
|
575
|
+
|
576
|
+
xx = None
|
577
|
+
if x == "time":
|
578
|
+
xx = pd.to_datetime(data["time"], format='%Y-%m-%d', errors='coerce')
|
579
|
+
elif x == "date":
|
580
|
+
xx = pd.to_datetime(data["date"], format='%d-%m-%Y', errors='coerce')
|
581
|
+
else:
|
582
|
+
xx = pd.to_numeric(data[x], errors="coerce")
|
583
|
+
|
584
|
+
yy = pd.to_numeric(data[val], errors="coerce")
|
585
|
+
|
586
|
+
yy_unit = ""
|
587
|
+
|
588
|
+
if (style == "Scatter"):
|
589
|
+
fig.add_trace(go.Scatter(x=xx, y=yy, name=val, mode='markers'))
|
590
|
+
elif (style == "Bars"):
|
591
|
+
fig.add_trace(go.Bar(x=xx, y=yy, name=val))
|
592
|
+
elif (style == "Lines"):
|
593
|
+
fig.add_trace(go.Scatter(x=xx, y=yy, name=val))
|
594
|
+
elif (style == "Area"):
|
595
|
+
fig.add_trace(go.Scatter(x=xx, y=yy, name=val, fill='tozeroy'))
|
596
|
+
elif (style == "Box"):
|
597
|
+
fig.add_trace(go.Box(x=xx, y=yy, name=val))
|
598
|
+
|
599
|
+
fig.update_layout(
|
600
|
+
title="",
|
601
|
+
xaxis_title=x,
|
602
|
+
yaxis_title=val,
|
603
|
+
font=dict(color='white'),
|
604
|
+
paper_bgcolor='rgba(42, 42, 42, 0)',
|
605
|
+
plot_bgcolor='rgb(62, 62, 62)',
|
606
|
+
xaxis=dict(
|
607
|
+
gridcolor='rgb(72, 72, 72)',
|
608
|
+
gridwidth=1
|
609
|
+
),
|
610
|
+
yaxis=dict(
|
611
|
+
title=val,
|
612
|
+
autorange=True,
|
613
|
+
gridcolor='rgb(72, 72, 72)',
|
614
|
+
gridwidth=0.1
|
615
|
+
)
|
616
|
+
)
|
617
|
+
all_figures.append(fig)
|
618
|
+
|
619
|
+
row = 1
|
620
|
+
col = 1
|
621
|
+
for fig in all_figures:
|
622
|
+
for trace in fig.data:
|
623
|
+
|
624
|
+
if trace.name not in color_dict:
|
625
|
+
color_dict[trace.name] = color_list[color_index % len(color_list)]
|
626
|
+
color_index += 1
|
627
|
+
|
628
|
+
trace.marker.color = color_dict[trace.name]
|
629
|
+
|
630
|
+
if fig_combined.data:
|
631
|
+
trace.showlegend = not any(t.name == trace.name for t in fig_combined.data)
|
632
|
+
fig_combined.add_trace(trace, row=row, col=col)
|
633
|
+
|
634
|
+
# Get the layout titles from the individual figure
|
635
|
+
xaxis_title = fig.layout.xaxis.title.text
|
636
|
+
yaxis_title = fig.layout.yaxis.title.text
|
637
|
+
|
638
|
+
# Update the combined figure's subplot with the titles
|
639
|
+
fig_combined.update_xaxes(title_text=xaxis_title, row=row, col=col)
|
640
|
+
fig_combined.update_yaxes(title_text=yaxis_title, row=row, col=col)
|
641
|
+
|
642
|
+
col += 1
|
643
|
+
if col > figures_per_row:
|
644
|
+
row += 1
|
645
|
+
col = 1
|
646
|
+
|
647
|
+
info = option_manager.get_project_data()
|
648
|
+
folder = os.path.join(info['path'], info['name'])
|
649
|
+
|
650
|
+
fig = fig_combined
|
651
|
+
fig.update_layout(
|
652
|
+
title="",
|
653
|
+
font=dict(color='white'),
|
654
|
+
paper_bgcolor='rgba(42, 42, 42, 0)',
|
655
|
+
plot_bgcolor='rgb(62, 62, 62)'
|
656
|
+
)
|
657
|
+
|
658
|
+
if not os.path.exists(folder):
|
659
|
+
os.makedirs(folder)
|
660
|
+
|
661
|
+
fig.write_image(os.path.join(folder, "matrix_editor.png"), width=1280, height=720)
|
662
|
+
fig.write_html(os.path.join(folder, "matrix_editor.html"), include_plotlyjs='cdn', auto_open=False)
|
663
|
+
with open(os.path.join(folder, "matrix_editor.html"), "r") as f:
|
664
|
+
html = f.read()
|
665
|
+
html = html.replace("<body>", "<body bgcolor='#2a2a2a'>")
|
666
|
+
with open(os.path.join(folder, "matrix_editor.html"), "w") as f:
|
667
|
+
f.write(html)
|
668
|
+
|
528
669
|
return fig
|
File without changes
|
File without changes
|
File without changes
|