mg-pso-gui 0.1.209__py3-none-any.whl → 0.1.213__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mg-pso-gui
3
- Version: 0.1.209
3
+ Version: 0.1.213
4
4
  Summary: GUI for MG-PSO
5
5
  Author: Robert Cordingly
6
6
  Author-email: <rcording@uw.ed>
@@ -21,7 +21,7 @@ mgpsogui/gui/SetupTab/StepView.py,sha256=C6DDinU9AgaUM1EOAHetFI4bE89ANJ247F0doks
21
21
  mgpsogui/gui/SetupTab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  mgpsogui/gui/VisualizeTab/MatrixEditor.py,sha256=JPQmfljdddIwHtTKpFqUdk7hRzVdX-IKl4neOk3DsjM,3132
23
23
  mgpsogui/gui/VisualizeTab/SideBar.py,sha256=MtZfDScNFN0fQ8DyPm6bZGJSrFRgT14fZeUq-qc61O8,21936
24
- mgpsogui/gui/VisualizeTab/VisualizeTab.py,sha256=gLDuI6rS21rYZ9v-77qffmtTp3NS9DdohrMQgo_JZvY,3953
24
+ mgpsogui/gui/VisualizeTab/VisualizeTab.py,sha256=JCm4qOe_l2vVTabBjGUHAK6fl21UQ4RhRLll_PIUFWI,6832
25
25
  mgpsogui/gui/VisualizeTab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
26
  mgpsogui/gui/images/IGOW 4 Logo.png,sha256=JixNXz5gOEj898VF-_PHthAlGU-6W-y9ucb4EVNPtjs,433752
27
27
  mgpsogui/gui/images/collapse.png,sha256=yicb16LaY7Nl5q9V8HHlht-Fbg5xU-l4_LJ_Arfmu1c,2989
@@ -34,7 +34,7 @@ mgpsogui/gui/images/stop.png,sha256=JPuxXQerCGpLikcp7cAj3iLCOjULMYYZ2sZe0lArh68,
34
34
  mgpsogui/gui/images/test.png,sha256=MUnVpRK-isxhEHzx4Q6Yh0M6FRZD1qvgCHH2XmiSBbk,3642
35
35
  mgpsogui/gui/images/trash.png,sha256=j8cf0kWbJd-4Jp20lUVV1o1NSeQ4v1Ej4gfcIA3DVRQ,2958
36
36
  mgpsogui/gui/images/up.png,sha256=AQvFWCUqSQNaQ1E6LKZ9zNfSvW6t4mgy8uswdg9T2Hg,2457
37
- mgpsogui/util/GraphGenerator.py,sha256=t2SS3dXyhYVZkeu1RskZlOjq85NYBXK6cdD0NbaMYTo,26310
37
+ mgpsogui/util/GraphGenerator.py,sha256=dkrGl5rkKJdloi_Mm-TKw4gEddpFlTJxiF1HZEH8Pzc,28627
38
38
  mgpsogui/util/PSORunner.py,sha256=ELpRgEpUiLV4hW-A-y4yzfkFN1BXgH7LZ0qlwWBRz3s,11012
39
39
  mgpsogui/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
40
  mgpsogui/util/debug.py,sha256=Swzny9_1S-CCONWGssj9iDoSpbwu5Vr4f95g_9L8bec,19759
@@ -60,8 +60,8 @@ mgpsogui/util/recosu/utils/trace_writer.py,sha256=V9BJlOjCbNYGoXGEk3CF5wjifBxvar
60
60
  mgpsogui/util/recosu/utils/utils.py,sha256=QB8vftq3142ekG0ORjz0ZBHU5YknXbR0oTsrxrPAsF0,3951
61
61
  mgpsogui/util/recosu/utils/plot/__init__.py,sha256=h1KjM7_tNDv351pcwt8A6Ibb1jhwWyx5Gbu-zj-sI3Q,71
62
62
  mgpsogui/util/recosu/utils/plot/cost_steps.py,sha256=1Ce11AJyweWkmvjXPxEygzS-h8yVLmQEDLS53yjPLqQ,3779
63
- mg_pso_gui-0.1.209.dist-info/METADATA,sha256=2kJji5mcHBn5t1pjIoQzJ9zfz0UiDUlYSL1hbJGBHTg,9456
64
- mg_pso_gui-0.1.209.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
65
- mg_pso_gui-0.1.209.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
66
- mg_pso_gui-0.1.209.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
67
- mg_pso_gui-0.1.209.dist-info/RECORD,,
63
+ mg_pso_gui-0.1.213.dist-info/METADATA,sha256=q1SRoqQHAafc-bm4NWTM4RlNyqrhWYY04R-IfnDWfEw,9456
64
+ mg_pso_gui-0.1.213.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
65
+ mg_pso_gui-0.1.213.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
66
+ mg_pso_gui-0.1.213.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
67
+ mg_pso_gui-0.1.213.dist-info/RECORD,,
@@ -4,6 +4,7 @@ from PIL import Image, ImageTk
4
4
  import os
5
5
  import platform
6
6
  import subprocess
7
+ import shutil
7
8
 
8
9
  from . import SideBar
9
10
 
@@ -27,7 +28,60 @@ def create_tab(self, tab):
27
28
  subprocess.Popen(["xdg-open", file_path])
28
29
 
29
30
  def export_graph():
30
- pass
31
+
32
+ info = self.option_manager.get_project_data()
33
+ folder = os.path.join(info['path'], info['name'])
34
+
35
+ if not os.path.exists(folder):
36
+ os.makedirs(folder)
37
+
38
+ html_file = os.path.join(folder, self.selected_graph_name + ".html")
39
+ json_file = os.path.join(folder, self.selected_graph_name + ".json")
40
+ png_file = os.path.join(folder, self.selected_graph_name + ".png")
41
+ pdf_file = os.path.join(folder, self.selected_graph_name + ".pdf")
42
+
43
+ # Make a directory call package
44
+ if not os.path.exists(os.path.join(folder, self.selected_graph_name + "_package")):
45
+ os.makedirs(os.path.join(folder, self.selected_graph_name + "_package"))
46
+
47
+ # Check if html_file exists and copy it to the package directory
48
+ if os.path.exists(html_file):
49
+ with open(html_file, 'r') as file:
50
+ data = file.read()
51
+ with open(os.path.join(folder, self.selected_graph_name + "_package", self.selected_graph_name + ".html"), 'w') as new_file:
52
+ new_file.write(data)
53
+
54
+ # Check if json_file exists and copy it to the package directory
55
+ if os.path.exists(json_file):
56
+ with open(json_file, 'r') as file:
57
+ data = file.read()
58
+ with open(os.path.join(folder, self.selected_graph_name + "_package", self.selected_graph_name + ".json"), 'w') as new_file:
59
+ new_file.write(data)
60
+
61
+ # Check if png_file exists and copy it to the package directory
62
+ if os.path.exists(png_file):
63
+ with open(png_file, 'rb') as file:
64
+ data = file.read()
65
+ with open(os.path.join(folder, self.selected_graph_name + "_package", self.selected_graph_name + ".png"), 'wb') as new_file:
66
+ new_file.write(data)
67
+
68
+ # Check if pdf_file exists and copy it to the package directory
69
+ if os.path.exists(pdf_file):
70
+ with open(pdf_file, 'rb') as file:
71
+ data = file.read()
72
+ with open(os.path.join(folder, self.selected_graph_name + "_package", self.selected_graph_name + ".pdf"), 'wb') as new_file:
73
+ new_file.write(data)
74
+
75
+ # Zip the package directory
76
+ shutil.make_archive(os.path.join(folder, self.selected_graph_name + "_package"), 'zip', os.path.join(folder, self.selected_graph_name + "_package"))
77
+
78
+ # Open the directory containing the package
79
+ if platform.system() == "Windows":
80
+ os.startfile(os.path.join(folder, self.selected_graph_name + "_package"))
81
+ elif platform.system() == "Darwin":
82
+ subprocess.Popen(["open", os.path.join(folder, self.selected_graph_name + "_package")])
83
+ else:
84
+ subprocess.Popen(["xdg-open", os.path.join(folder, self.selected_graph_name + "_package")])
31
85
 
32
86
  def _resize_image(event):
33
87
  self.graph_label.update_idletasks()
@@ -9,6 +9,9 @@ import customtkinter
9
9
  import traceback
10
10
  import math
11
11
 
12
+ baseFigureWidth = 700
13
+ baseFigureHeight = 350
14
+
12
15
  theme_background_color = {
13
16
  "Dark": 'rgba(42, 42, 42, 0)',
14
17
  "Light": 'rgba(255, 255, 255, 0)',
@@ -139,6 +142,12 @@ def best_cost_stacked(homepage, config, data, option_manager):
139
142
  gridwidth=0.1
140
143
  )
141
144
  )
145
+ if (theme == "Publication"):
146
+ fig.update_layout(
147
+ font=dict(
148
+ size=16
149
+ )
150
+ )
142
151
 
143
152
  info = option_manager.get_project_data()
144
153
  folder = os.path.join(info['path'], info['name'])
@@ -149,6 +158,7 @@ def best_cost_stacked(homepage, config, data, option_manager):
149
158
  fig.write_image(os.path.join(folder, "best_cost_stacked.png"), width=1280, height=720)
150
159
  fig.write_html(os.path.join(folder, "best_cost_stacked.html"), include_plotlyjs='cdn', auto_open=False)
151
160
  fig.write_json(os.path.join(folder, "best_cost_stacked.json"))
161
+ fig.write_image(os.path.join(folder, "best_cost_stacked.pdf"), engine="kaleido", width=baseFigureWidth, height=baseFigureHeight)
152
162
  with open(os.path.join(folder, "best_cost_stacked.html"), "r") as f:
153
163
  html = f.read()
154
164
  html = html.replace("<body>", "<body bgcolor='#2a2a2a'>")
@@ -192,6 +202,12 @@ def table(homepage, config, dataframe, option_manager):
192
202
  gridwidth=0.1
193
203
  )
194
204
  )
205
+ if (theme == "Publication"):
206
+ fig.update_layout(
207
+ font=dict(
208
+ size=16
209
+ )
210
+ )
195
211
 
196
212
  info = option_manager.get_project_data()
197
213
  folder = os.path.join(info['path'], info['name'])
@@ -202,6 +218,7 @@ def table(homepage, config, dataframe, option_manager):
202
218
  fig.write_image(os.path.join(folder, "table.png"), width=1280, height=720)
203
219
  fig.write_html(os.path.join(folder, "table.html"), include_plotlyjs='cdn', auto_open=False)
204
220
  fig.write_json(os.path.join(folder, "table.json"))
221
+ fig.write_image(os.path.join(folder, "table.pdf"), engine="kaleido", width=baseFigureWidth, height=baseFigureHeight)
205
222
  with open(os.path.join(folder, "table.html"), "r") as f:
206
223
  html = f.read()
207
224
  html = html.replace("<body>", "<body bgcolor='#2a2a2a'>")
@@ -277,6 +294,12 @@ def best_cost_by_round(homepage, config, data, option_manager):
277
294
  gridwidth=0.1
278
295
  )
279
296
  )
297
+ if (theme == "Publication"):
298
+ fig.update_layout(
299
+ font=dict(
300
+ size=16
301
+ )
302
+ )
280
303
 
281
304
  info = option_manager.get_project_data()
282
305
  folder = os.path.join(info['path'], info['name'])
@@ -287,6 +310,7 @@ def best_cost_by_round(homepage, config, data, option_manager):
287
310
  fig.write_image(os.path.join(folder, "best_cost_by_round.png"), width=1280, height=720)
288
311
  fig.write_html(os.path.join(folder, "best_cost_by_round.html"), include_plotlyjs='cdn', auto_open=False)
289
312
  fig.write_json(os.path.join(folder, "best_cost_by_round.json"))
313
+ fig.write_image(os.path.join(folder, "best_cost_by_round.pdf"), engine="kaleido", width=baseFigureWidth, height=baseFigureHeight)
290
314
  with open(os.path.join(folder, "best_cost_by_round.html"), "r") as f:
291
315
  html = f.read()
292
316
  html = html.replace("<body>", "<body bgcolor='#2a2a2a'>")
@@ -345,6 +369,12 @@ def calibrated_params_by_round(homepage, config, list_of_objs, option_manager):
345
369
  gridwidth=0.1
346
370
  )
347
371
  )
372
+ if (theme == "Publication"):
373
+ fig.update_layout(
374
+ font=dict(
375
+ size=16
376
+ )
377
+ )
348
378
 
349
379
  info = option_manager.get_project_data()
350
380
  folder = os.path.join(info['path'], info['name'])
@@ -355,6 +385,7 @@ def calibrated_params_by_round(homepage, config, list_of_objs, option_manager):
355
385
  fig.write_image(os.path.join(folder, "calibrated_params_by_round.png"), width=1280, height=720)
356
386
  fig.write_html(os.path.join(folder, "calibrated_params_by_round.html"), include_plotlyjs='cdn', auto_open=False)
357
387
  fig.write_json(os.path.join(folder, "calibrated_params_by_round.json"))
388
+ fig.write_image(os.path.join(folder, "calibrated_params_by_round.pdf"), engine="kaleido", width=baseFigureWidth, height=baseFigureHeight)
358
389
  with open(os.path.join(folder, "calibrated_params_by_round.html"), "r") as f:
359
390
  html = f.read()
360
391
  html = html.replace("<body>", "<body bgcolor='#2a2a2a'>")
@@ -420,6 +451,12 @@ def custom_csv(homepage, option_manager):
420
451
  side='right'
421
452
  )
422
453
  )
454
+ if (theme == "Publication"):
455
+ fig.update_layout(
456
+ font=dict(
457
+ size=16
458
+ )
459
+ )
423
460
 
424
461
  info = option_manager.get_project_data()
425
462
  folder = os.path.join(info['path'], info['name'])
@@ -430,6 +467,7 @@ def custom_csv(homepage, option_manager):
430
467
  fig.write_image(os.path.join(folder, "custom_csv.png"), width=1280, height=720)
431
468
  fig.write_html(os.path.join(folder, "custom_csv.html"), include_plotlyjs='cdn', auto_open=False)
432
469
  fig.write_json(os.path.join(folder, "custom_csv.json"))
470
+ fig.write_image(os.path.join(folder, "custom_csv.pdf"), engine="kaleido", width=baseFigureWidth, height=baseFigureHeight)
433
471
  with open(os.path.join(folder, "custom_csv.html"), "r") as f:
434
472
  html = f.read()
435
473
  html = html.replace("<body>", "<body bgcolor='#2a2a2a'>")
@@ -504,6 +542,12 @@ def compare_csv(homepage, option_manager):
504
542
  side='right'
505
543
  )
506
544
  )
545
+ if (theme == "Publication"):
546
+ fig.update_layout(
547
+ font=dict(
548
+ size=16
549
+ )
550
+ )
507
551
 
508
552
  info = option_manager.get_project_data()
509
553
  folder = os.path.join(info['path'], info['name'])
@@ -514,6 +558,7 @@ def compare_csv(homepage, option_manager):
514
558
  fig.write_image(os.path.join(folder, "compare_csv.png"), width=1280, height=720)
515
559
  fig.write_html(os.path.join(folder, "compare_csv.html"), include_plotlyjs='cdn', auto_open=False)
516
560
  fig.write_json(os.path.join(folder, "compare_csv.json"))
561
+ fig.write_image(os.path.join(folder, "compare_csv.pdf"), engine="kaleido", width=baseFigureWidth, height=baseFigureHeight)
517
562
  with open(os.path.join(folder, "compare_csv.html"), "r") as f:
518
563
  html = f.read()
519
564
  html = html.replace("<body>", "<body bgcolor='#2a2a2a'>")
@@ -590,6 +635,12 @@ def sampling_csv(homepage, option_manager):
590
635
  side='right'
591
636
  )
592
637
  )
638
+ if (theme == "Publication"):
639
+ fig.update_layout(
640
+ font=dict(
641
+ size=16
642
+ )
643
+ )
593
644
 
594
645
  info = option_manager.get_project_data()
595
646
  folder = os.path.join(info['path'], info['name'])
@@ -600,6 +651,7 @@ def sampling_csv(homepage, option_manager):
600
651
  fig.write_image(os.path.join(folder, "sampling_csv.png"), width=1280, height=720)
601
652
  fig.write_html(os.path.join(folder, "sampling_csv.html"), include_plotlyjs='cdn', auto_open=False)
602
653
  fig.write_json(os.path.join(folder, "sampling_csv.json"))
654
+ fig.write_image(os.path.join(folder, "sampling_csv.pdf"), engine="kaleido", width=baseFigureWidth, height=baseFigureHeight)
603
655
  with open(os.path.join(folder, "sampling_csv.html"), "r") as f:
604
656
  html = f.read()
605
657
  html = html.replace("<body>", "<body bgcolor='#2a2a2a'>")
@@ -618,7 +670,7 @@ def matrix_editor(homepage, option_manager):
618
670
  all_figures = []
619
671
  figure_parameters = option_manager.get_arguments()['figure_parameters']
620
672
 
621
- color_list = ['#636EFA', '#EF553B', '#00CC96', '#AB63FA', '#FFA15A', '#19D3F3', '#FF6692', '#B6E880', '#FF97FF', '#FECB52']
673
+ #color_list = ['#636EFA', '#EF553B', '#00CC96', '#AB63FA', '#FFA15A', '#19D3F3', '#FF6692', '#B6E880', '#FF97FF', '#FECB52']
622
674
  color_index = 0
623
675
  color_dict = {}
624
676
 
@@ -699,6 +751,13 @@ def matrix_editor(homepage, option_manager):
699
751
  gridwidth=0.1
700
752
  )
701
753
  )
754
+ if (theme == "Publication"):
755
+ fig.update_layout(
756
+ font=dict(
757
+ size=16
758
+ )
759
+ )
760
+
702
761
  all_figures.append(fig)
703
762
 
704
763
  row = 1
@@ -707,7 +766,7 @@ def matrix_editor(homepage, option_manager):
707
766
  for trace in fig.data:
708
767
 
709
768
  if trace.name not in color_dict:
710
- color_dict[trace.name] = color_list[color_index % len(color_list)]
769
+ color_dict[trace.name] = theme_plot_color_pallet[color_index % len(theme_plot_color_pallet)]
711
770
  color_index += 1
712
771
 
713
772
  trace.marker.color = color_dict[trace.name]
@@ -739,6 +798,12 @@ def matrix_editor(homepage, option_manager):
739
798
  paper_bgcolor=theme_background_color[theme],
740
799
  plot_bgcolor=theme_plot_color[theme]
741
800
  )
801
+ if (theme == "Publication"):
802
+ fig.update_layout(
803
+ font=dict(
804
+ size=16
805
+ )
806
+ )
742
807
 
743
808
  if not os.path.exists(folder):
744
809
  os.makedirs(folder)
@@ -746,6 +811,7 @@ def matrix_editor(homepage, option_manager):
746
811
  fig.write_image(os.path.join(folder, "matrix_editor.png"), width=1280, height=720)
747
812
  fig.write_html(os.path.join(folder, "matrix_editor.html"), include_plotlyjs='cdn', auto_open=False)
748
813
  fig.write_json(os.path.join(folder, "matrix_editor.json"))
814
+ fig.write_image(os.path.join(folder, "matrix_editor.pdf"), engine="kaleido", width=baseFigureWidth, height=baseFigureHeight)
749
815
  with open(os.path.join(folder, "matrix_editor.html"), "r") as f:
750
816
  html = f.read()
751
817
  html = html.replace("<body>", "<body bgcolor='#2a2a2a'>")