mg-pso-gui 0.2.124__py3-none-any.whl → 0.2.125__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.2.124
3
+ Version: 0.2.125
4
4
  Summary: GUI for MG-PSO
5
5
  Author: Robert Cordingly
6
6
  Author-email: <rcording@uw.ed>
@@ -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=Lz0P7TgRwzvocxxNWr84d-LvMzdTs_VvwrNkxP28kuI,25155
4
+ mgpsogui/gui/HomePage.py,sha256=N_0FGZ8R6fiMBHiNWYNMM8h3QvudteaJ_Fq5GDxoPug,26053
5
5
  mgpsogui/gui/OptionManager.py,sha256=t0aXOeBo48qQ-P8OykpP2v_3KJoaJtUPSkYtacjloCc,22844
6
6
  mgpsogui/gui/OptionManager_backup.py,sha256=TCWfPnHL2foN5id47jsi267lamRG6yGU6y_M29eOOJk,18530
7
7
  mgpsogui/gui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -58,7 +58,7 @@ mgpsogui/util/CTkToolTip/ctk_tooltip.py,sha256=SZMovpQIGvdpDRbqCKl9SHs92DrFCO2MO
58
58
  mgpsogui/util/recosu/__init__.py,sha256=pPR0lB6clIi6q73H1W8eT5u0dd3bIemwa9-XFmOaVVk,279
59
59
  mgpsogui/util/recosu/pso/__init__.py,sha256=PQ548aEKVOk6MMzxxDg7yMO_1hHfoEoYLLkGLeij73Y,247
60
60
  mgpsogui/util/recosu/pso/csip_access.py,sha256=_oA71d6CSwhKSa3pgywIW7mXRJtgJTNu1X2DiBkQkuA,4152
61
- mgpsogui/util/recosu/pso/pso.py,sha256=kO0E-OEaSCAaRJX0W72NRh3zvOXA61Qv6AZLZxnAhGk,23185
61
+ mgpsogui/util/recosu/pso/pso.py,sha256=qUwpp6gjhCTXA6twKGAda84HIeQebKGB6MJ4K9GfcdM,23181
62
62
  mgpsogui/util/recosu/sampling/__init__.py,sha256=dWs1MPx0o2UFmOmUfFaomQWBTIZAwALsVJzZQNZePZU,252
63
63
  mgpsogui/util/recosu/sampling/sample_trace_writer.py,sha256=M9w-POLlZgjL5a7J7yxr73OG6mCsS2aUuP9d3HKfkbA,1966
64
64
  mgpsogui/util/recosu/sampling/sampler_task.py,sha256=uZobpR83u6xEaUzIknvW9FbB84c2AL7T-5T8O8QIhzY,2776
@@ -73,8 +73,8 @@ mgpsogui/util/recosu/utils/trace_writer.py,sha256=V9BJlOjCbNYGoXGEk3CF5wjifBxvar
73
73
  mgpsogui/util/recosu/utils/utils.py,sha256=6MIoJb0nhIa4tNv7qhBfZi-AtL3L95CgJf6eAf12NQs,4140
74
74
  mgpsogui/util/recosu/utils/plot/__init__.py,sha256=h1KjM7_tNDv351pcwt8A6Ibb1jhwWyx5Gbu-zj-sI3Q,71
75
75
  mgpsogui/util/recosu/utils/plot/cost_steps.py,sha256=1Ce11AJyweWkmvjXPxEygzS-h8yVLmQEDLS53yjPLqQ,3779
76
- mg_pso_gui-0.2.124.dist-info/METADATA,sha256=xhxbNuuONZLy4BO01-WLcMdSEx5JRYmu8adzJhyy8Hk,9542
77
- mg_pso_gui-0.2.124.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
78
- mg_pso_gui-0.2.124.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
79
- mg_pso_gui-0.2.124.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
80
- mg_pso_gui-0.2.124.dist-info/RECORD,,
76
+ mg_pso_gui-0.2.125.dist-info/METADATA,sha256=1cfBNFu2xvNbvbzQQKz2JtmCFVC5Z49qKHPxNW0oWB4,9542
77
+ mg_pso_gui-0.2.125.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
78
+ mg_pso_gui-0.2.125.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
79
+ mg_pso_gui-0.2.125.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
80
+ mg_pso_gui-0.2.125.dist-info/RECORD,,
mgpsogui/gui/HomePage.py CHANGED
@@ -113,6 +113,8 @@ class App(customtkinter.CTk):
113
113
  self.calibration_data = None
114
114
  self.testing = False
115
115
 
116
+ self.running_loop_ticks = 1
117
+
116
118
  # Configure window
117
119
  version = "v0.2.120"
118
120
  self.title("COSU Manager (" + version + ")")
@@ -241,7 +243,8 @@ class App(customtkinter.CTk):
241
243
  GraphGenerator.generate_graphs(self)
242
244
 
243
245
  def save_project(self):
244
- filename = asksaveasfilename(filetypes=[("JSON", "*.json")], initialfile="config", defaultextension="json", title="Save Project")
246
+ name = self.option_manager.get_project_data()['name']
247
+ filename = asksaveasfilename(filetypes=[("JSON", "*.json")], initialfile=name, defaultextension="json", title="Save Project")
245
248
 
246
249
  try:
247
250
  self.option_manager.set_path(filename)
@@ -260,6 +263,29 @@ class App(customtkinter.CTk):
260
263
  self.save_button.configure(text="Error!")
261
264
  print(e)
262
265
  self.after(3000, lambda: self.save_button.configure(text="Save"))
266
+
267
+ def auto_save_project(self):
268
+ data = self.option_manager.get_project_data()
269
+
270
+ if (data['path'] != "/tmp"):
271
+ filename = os.path.join(data['path'], data['name'] + ".json")
272
+
273
+ try:
274
+ self.option_manager.set_path(filename)
275
+ self.option_manager.save_project(filename)
276
+
277
+ folder = self.option_manager.get_project_folder()
278
+ if not os.path.exists(folder):
279
+ os.makedirs(folder)
280
+
281
+ if not os.path.exists(os.path.join(folder, "results")):
282
+ os.makedirs(os.path.join(folder, "results"))
283
+
284
+ self.save_button.configure(text="Saved!")
285
+ self.after(1000, lambda: self.save_button.configure(text="Save"))
286
+ except Exception as e:
287
+ self.save_button.configure(text="Error!")
288
+ print(e)
263
289
 
264
290
  def refresh_step_view(self, value):
265
291
  mode = self.option_manager.get_mode()
@@ -528,8 +554,11 @@ class App(customtkinter.CTk):
528
554
  active_tab = self.tabview.get()
529
555
  if (active_tab == "Results"):
530
556
  GraphGenerator.generate_graphs(self)
557
+ if (self.running_loop_ticks % 10 == 0):
558
+ self.auto_save_project()
531
559
  finally:
532
560
  self.after(1000, self.running_loop)
561
+ self.running_loop_ticks += 1
533
562
 
534
563
  def watch_loop(self):
535
564
  print("Watch loop running...")
@@ -95,7 +95,7 @@ def eval_cost(x, iteration, step_param, step_objfunc, calib_params, req_queue, f
95
95
 
96
96
  for key in cost2:
97
97
  # print(key, ' - ', cost2[key])
98
- cost2[key][iteration - 1][1] = cost[key] # BUG LIST INDEX OUT OF RANGE?
98
+ cost2[key][iteration][1] = cost[key] # BUG LIST INDEX OUT OF RANGE?
99
99
  # print(key, ' - ', cost2[key])
100
100
 
101
101
  print(flush=True)