mg-pso-gui 0.1.115__tar.gz → 0.1.118__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.
Files changed (60) hide show
  1. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/PKG-INFO +1 -1
  2. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mg_pso_gui.egg-info/PKG-INFO +1 -1
  3. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/HomePage.py +20 -87
  4. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/util/PSORunner.py +2 -2
  5. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/util/sampler_test_driver.py +2 -0
  6. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/setup.py +1 -1
  7. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mg_pso_gui.egg-info/SOURCES.txt +0 -0
  8. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mg_pso_gui.egg-info/dependency_links.txt +0 -0
  9. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mg_pso_gui.egg-info/entry_points.txt +0 -0
  10. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mg_pso_gui.egg-info/requires.txt +0 -0
  11. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mg_pso_gui.egg-info/top_level.txt +0 -0
  12. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/__init__.py +0 -0
  13. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/OptionManager.py +0 -0
  14. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/PlatformTab/PlatformTab.py +0 -0
  15. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/PlatformTab/__init__.py +0 -0
  16. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/RunTab/RunTab.py +0 -0
  17. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/RunTab/__init__.py +0 -0
  18. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/SetupTab/BoundsEditorWindow.py +0 -0
  19. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/SetupTab/BoundsList.py +0 -0
  20. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/SetupTab/CalibrationParametersView.py +0 -0
  21. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/SetupTab/FunctionsList.py +0 -0
  22. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/SetupTab/ListParametersView.py +0 -0
  23. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/SetupTab/OptimalParameterView.py +0 -0
  24. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/SetupTab/SetupTab.py +0 -0
  25. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/SetupTab/StaticParameterView.py +0 -0
  26. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/SetupTab/StepView.py +0 -0
  27. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/SetupTab/__init__.py +0 -0
  28. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/VisualizeTab/SideBar.py +0 -0
  29. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/VisualizeTab/VisualizeTab.py +0 -0
  30. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/VisualizeTab/__init__.py +0 -0
  31. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/__init__.py +0 -0
  32. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/images/IGOW 4 Logo.png +0 -0
  33. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/images/collapse.png +0 -0
  34. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/images/down.png +0 -0
  35. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/images/expand.png +0 -0
  36. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/images/play.png +0 -0
  37. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/images/refresh.png +0 -0
  38. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/images/refresh_hd.png +0 -0
  39. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/images/stop.png +0 -0
  40. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/images/test.png +0 -0
  41. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/images/trash.png +0 -0
  42. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/gui/images/up.png +0 -0
  43. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/mgpsogui.py +0 -0
  44. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/start.yaml +0 -0
  45. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/util/CTkToolTip/__init__.py +0 -0
  46. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/util/CTkToolTip/ctk_tooltip.py +0 -0
  47. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/util/GraphGenerator.py +0 -0
  48. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/util/__init__.py +0 -0
  49. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/util/debug.py +0 -0
  50. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/util/helpers.py +0 -0
  51. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/util/recosu/__init__.py +0 -0
  52. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/util/recosu/pso/__init__.py +0 -0
  53. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/util/recosu/pso/csip_access.py +0 -0
  54. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/util/recosu/pso/pso.py +0 -0
  55. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/util/recosu/utils/__init__.py +0 -0
  56. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/util/recosu/utils/plot/__init__.py +0 -0
  57. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/util/recosu/utils/plot/cost_steps.py +0 -0
  58. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/util/recosu/utils/trace_writer.py +0 -0
  59. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/mgpsogui/util/recosu/utils/utils.py +0 -0
  60. {mg-pso-gui-0.1.115 → mg-pso-gui-0.1.118}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mg-pso-gui
3
- Version: 0.1.115
3
+ Version: 0.1.118
4
4
  Summary: GUI for MG-PSO
5
5
  Author: Robert Cordingly
6
6
  Author-email: <rcording@uw.ed>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mg-pso-gui
3
- Version: 0.1.115
3
+ Version: 0.1.118
4
4
  Summary: GUI for MG-PSO
5
5
  Author: Robert Cordingly
6
6
  Author-email: <rcording@uw.ed>
@@ -1,4 +1,4 @@
1
- #!/usr/local/bin/python3.9
1
+ #!/usr/local/bin/python3.10
2
2
 
3
3
  import os
4
4
  import time
@@ -55,7 +55,6 @@ customtkinter.set_default_color_theme("blue") # Themes: "blue" (standard), "gre
55
55
  results_queue = Queue()
56
56
  stdout_queue = Queue()
57
57
  stderr_queue = Queue()
58
- cosu_queue = Queue()
59
58
 
60
59
  class App(customtkinter.CTk):
61
60
  def __init__(self):
@@ -70,7 +69,7 @@ class App(customtkinter.CTk):
70
69
  self.selected_csv.set("No files found...")
71
70
  self.open_file = "None"
72
71
  self.csv_data = None
73
-
72
+
74
73
  self.selected_csv2 = tk.StringVar()
75
74
  self.selected_csv2.set("No files found...")
76
75
  self.open_file2 = "None"
@@ -99,7 +98,7 @@ class App(customtkinter.CTk):
99
98
  self.progress_data = None
100
99
  self.calibration_data = None
101
100
  self.testing = False
102
-
101
+
103
102
  # configure window
104
103
  self.title("CSIP PSO")
105
104
  self.geometry(f"{1920}x{1080}")
@@ -130,18 +129,22 @@ class App(customtkinter.CTk):
130
129
  self.refresh_button = customtkinter.CTkButton(self.sidebar_frame, text=None, width=30, image=refresh_image, command=self.load)
131
130
  ctt(self.refresh_button, delay=0.1, alpha=0.95, message="Connect to Service")
132
131
  self.refresh_button.grid(row=0, column=5, padx=(5, 80), pady=header_padding_y)
132
+
133
+ self.algorithm_optionmenu = customtkinter.CTkOptionMenu(self.sidebar_frame, variable=self.option_manager.get_arguments()['mode'], values=["Optimization: MG-PSO", "Sampling: Halton", "Sampling: Random"], width=50, command=self.refresh_step_view)
134
+ self.algorithm_optionmenu.grid(row=0, column=6, padx=header_padding_x, pady=header_padding_y)
135
+ self.algorithm_optionmenu.set("Optimization: MG-PSO")
133
136
 
134
137
  self.scaling_label = customtkinter.CTkLabel(self.sidebar_frame, text="Scale:", anchor="w")
135
- self.scaling_label.grid(row=0, column=6, padx=header_padding_x, pady=header_padding_y)
138
+ self.scaling_label.grid(row=0, column=7, padx=header_padding_x, pady=header_padding_y)
136
139
  self.scaling_optionemenu = customtkinter.CTkOptionMenu(self.sidebar_frame, values=["50%", "75%", "100%", "125%", "150%", "175%", "200%"], width=60,
137
- command=self.change_scaling_event)
138
- self.scaling_optionemenu.grid(row=0, column=7, padx=header_padding_x, pady=header_padding_y)
140
+ command=self.change_scaling_event)
141
+ self.scaling_optionemenu.grid(row=0, column=8, padx=header_padding_x, pady=header_padding_y)
139
142
  self.scaling_optionemenu.set("100%")
140
143
 
141
144
  expand_image = customtkinter.CTkImage(Image.open(os.path.join("./images", "expand.png")), size=(20, 20))
142
145
  self.new_window = customtkinter.CTkButton(self.sidebar_frame, text=None, width=30, image=expand_image, command=self.open_new_window)
143
146
  ctt(self.new_window, delay=0.1, alpha=0.95, message="Open New Window")
144
- self.new_window.grid(row=0, column=8, padx=(5, 20), pady=header_padding_y)
147
+ self.new_window.grid(row=0, column=9, padx=(5, 20), pady=header_padding_y)
145
148
 
146
149
  self.tabview = customtkinter.CTkTabview(self, bg_color="transparent", fg_color="transparent")
147
150
  self.tabview.grid(row=1, column=0, padx=(0, 0), pady=(10, 10), sticky="nsew")
@@ -149,15 +152,11 @@ class App(customtkinter.CTk):
149
152
  tab2 = "Setup"
150
153
  tab3 = "Logs"
151
154
  tab4 = "Results"
152
- #tab5 = "Results"
153
155
 
154
156
  self.tabview.add(tab1)
155
157
  self.tabview.add(tab2)
156
158
  self.tabview.add(tab4)
157
159
  self.tabview.add(tab3)
158
- #self.tabview.add(tab5)
159
-
160
- #self.tabview.configure(state="disabled")
161
160
 
162
161
  pt.create_tab(self, self.tabview.tab(tab1))
163
162
  st.create_tab(self, self.tabview.tab(tab2))
@@ -174,10 +173,6 @@ class App(customtkinter.CTk):
174
173
  self.footer_progress_bar = customtkinter.CTkProgressBar(self.footer_frame)
175
174
  self.footer_progress_bar.grid(row=0, column=4, padx=(50, 100), pady=header_padding_y, sticky="ew")
176
175
  self.footer_progress_bar.set(0)
177
-
178
- self.algorithm_optionmenu = customtkinter.CTkOptionMenu(self.footer_frame, variable=self.option_manager.get_arguments()['mode'], values=["PSO", "Halton"], width=50, command=self.refresh_step_view)
179
- self.algorithm_optionmenu.grid(row=0, column=6, padx=header_padding_x, pady=header_padding_y)
180
- self.algorithm_optionmenu.set("PSO")
181
176
 
182
177
  play_image = customtkinter.CTkImage(Image.open(os.path.join("./images", "play.png")), size=(20, 20))
183
178
  self.run_button = customtkinter.CTkButton(self.footer_frame, text=None, width=30, image=play_image, command=self.run)
@@ -204,55 +199,10 @@ class App(customtkinter.CTk):
204
199
  def update_graph(self, value):
205
200
  self.vis_sidebar.refresh()
206
201
  GraphGenerator.generate_graphs(self)
207
-
208
- '''def _resize_image(self, event):
209
- self.graph_label.update_idletasks()
210
- new_width = self.graph_label.winfo_width()
211
- new_height = self.graph_label.winfo_height()
212
-
213
- alt_width = new_height * 1.77778
214
- alt_height = new_width / 1.77778
215
-
216
- if (new_width < new_height):
217
- new_height = alt_height
218
- else:
219
- new_width = alt_width
220
-
221
- self.image_width = new_width
222
- self.image_height = new_height
223
-
224
- self.graph_image = customtkinter.CTkImage(self.graph_image_obj, size=(new_width, new_height))
225
- self.graph_label.configure(image=self.graph_image)
226
- self.graph_label.update_idletasks()
227
-
228
-
229
- def update_graph(self, value):
230
- selected_graph = self.graph_selector_value.get()
231
- info = self.option_manager.get_project_data()
232
- folder = os.path.join(info['path'], info['name'])
233
-
234
- if not os.path.exists(folder):
235
- os.makedirs(folder)
236
-
237
- if (selected_graph == "Best Cost Stacked"):
238
- self.selected_graph_name = "best_cost_stacked"
239
- elif (selected_graph == "Best Cost by Round"):
240
- self.selected_graph_name = "best_cost_by_round"
241
- elif (selected_graph == "Iteration Table"):
242
- self.selected_graph_name = "table"
243
- elif (selected_graph == "Calibrated Parameters"):
244
- self.selected_graph_name = "calibrated_params_by_round"
245
-
246
- image_path = os.path.join(folder, self.selected_graph_name + ".png")
247
- if not os.path.exists(image_path):
248
- image_path = os.path.join("./images", "up.png")
249
- self.graph_image_obj = Image.open(image_path)
250
- self.graph_image = customtkinter.CTkImage(self.graph_image_obj, size=(self.image_width * self.image_scale, self.image_height * self.image_scale))
251
- self.graph_label.configure(image=self.graph_image)'''
252
202
 
253
203
  def save_project(self):
254
204
  metrics = self.option_manager.get_metrics()
255
-
205
+
256
206
  # Add the calibration_progress dataframe to the json
257
207
  if (self.progress_data is not None):
258
208
  metrics["calibration_progress"] = self.progress_data.to_json()
@@ -280,7 +230,7 @@ class App(customtkinter.CTk):
280
230
  self.steps_frame.render()
281
231
  self.optimal_param_frame.clear()
282
232
  self.optimal_param_frame.render()
283
-
233
+
284
234
  def open_new_window(self):
285
235
  # Shell out and run ./main.py
286
236
  subprocess.Popen(["python3", "../mgpsogui.py"])
@@ -390,7 +340,7 @@ class App(customtkinter.CTk):
390
340
  def run_test(self):
391
341
  self.testing = True
392
342
  self.run()
393
-
343
+
394
344
  def run(self):
395
345
  metrics = self.option_manager.get_metrics()
396
346
  self.running_config = metrics
@@ -401,7 +351,7 @@ class App(customtkinter.CTk):
401
351
  for param in step['param']:
402
352
  param['default_value'] = param['optimal_value']
403
353
  self.testing = False
404
-
354
+
405
355
  self.progress_data = None
406
356
  self.calibration_data = None
407
357
 
@@ -432,7 +382,7 @@ class App(customtkinter.CTk):
432
382
  if (os.path.exists(os.path.join(folder, 'error.txt'))):
433
383
  os.remove(os.path.join(folder, 'error.txt'))
434
384
 
435
- self.train_process = Process(target=PSORunner.run_process, args=(stdout_queue, stderr_queue, results_queue, cosu_queue, metrics, folder))
385
+ self.train_process = Process(target=PSORunner.run_process, args=(stdout_queue, stderr_queue, results_queue, metrics, folder))
436
386
  self.train_process.daemon = True
437
387
  self.train_process.start()
438
388
  self.after(1000, self.watch_loop)
@@ -508,38 +458,28 @@ class App(customtkinter.CTk):
508
458
  print("# " + stdout_line, flush=True)
509
459
  with open(os.path.join(folder, 'output.txt'), 'a') as f:
510
460
  f.write(stdout_line)
511
-
512
461
  except Empty:
513
462
  break
514
463
 
515
464
  while True:
516
465
  try:
517
466
  stderr_line = stderr_queue.get_nowait()
518
-
519
467
  print("? " + stderr_line, flush=True)
520
468
  with open(os.path.join(folder, 'error.txt'), 'a') as f:
521
469
  f.write(stderr_line)
522
470
 
523
471
  except Empty:
524
472
  break
525
-
526
- while True:
527
- try:
528
- cosu_line = cosu_queue.get_nowait()
529
-
530
- print("COSU " + cosu_line, flush=True)
531
- except Empty:
532
- break
533
473
 
534
474
  while True:
535
475
  try:
536
476
  trace = results_queue.get_nowait()
537
477
 
538
478
  print("TRACE " + str(trace), flush=True)
539
-
479
+
540
480
  final_results = hp.extract_final_round_values(trace)
541
481
  print("Final results: " + str(final_results), flush=True)
542
-
482
+
543
483
  all_steps = self.option_manager.get_steps()
544
484
  data = final_results["data"]
545
485
  index = 0
@@ -552,14 +492,13 @@ class App(customtkinter.CTk):
552
492
  target_param['optimal_value'].set(value)
553
493
  index += 1
554
494
  print("Applied optimal values")
555
-
556
-
557
495
  except Empty:
558
496
  break
559
497
  except Exception as e:
560
498
  print("Some error happened when getting the trace!")
561
499
  print(e)
562
500
 
501
+ # Write output to textbox
563
502
  if (os.path.exists(os.path.join(folder, 'output.txt'))):
564
503
  with open(os.path.join(folder, 'output.txt'), 'r') as f:
565
504
  lines = f.readlines()
@@ -572,6 +511,7 @@ class App(customtkinter.CTk):
572
511
  print(new_characters, end="")
573
512
 
574
513
  try:
514
+ # REPLACE THIS WITH READING THE STEP TRACE JSON for PSO
575
515
  with open(os.path.join(folder, "output.txt"), "r") as f:
576
516
  text = f.read()
577
517
 
@@ -593,17 +533,10 @@ class App(customtkinter.CTk):
593
533
  calibrated_params = [ast.literal_eval(i) for i in calibrated_params]
594
534
  best_particle_values = [ast.literal_eval(i) for i in best_particle_values]
595
535
  progress_values = [tuple(map(float, i)) for i in progress_values]
596
-
597
- #print("Current params: " + str(calibrated_params), flush=True)
598
-
599
536
  self.calibration_data = calibrated_params
600
537
 
601
- #GraphGenerator.calibrated_params_by_round(self.running_config['steps'], calibrated_params, self.option_manager)
602
- #self.update_graph("")
603
538
  except Exception as e:
604
- # Print stack trace
605
539
  traceback.print_exc()
606
-
607
540
  print(e)
608
541
 
609
542
  if (os.path.exists(os.path.join(folder, 'error.txt'))):
@@ -14,7 +14,7 @@ def enqueue_output(out, queue):
14
14
  queue.put(line)
15
15
  out.close()
16
16
 
17
- def run_process(stdout_queue, stderr_queue, results_queue, cosu_queue, data, folder):
17
+ def run_process(stdout_queue, stderr_queue, results_queue, data, folder):
18
18
  steps = data['steps']
19
19
  args = data['arguments']
20
20
  calib = data['calibration_parameters']
@@ -73,7 +73,7 @@ def run_process(stdout_queue, stderr_queue, results_queue, cosu_queue, data, fol
73
73
  'http_conn_timeout': int(calibration_map['conn_timeout']),
74
74
  'http_read_timeout': int(calibration_map['read_timeout']),
75
75
  'particles_fail': int(calibration_map['particles_fail']),
76
- 'step_trace': os.path.join(folder, 'step_trace.json')
76
+ 'step_trace': os.path.join(folder, 'pso_step_trace.json')
77
77
  }
78
78
 
79
79
  print("\n")
@@ -119,6 +119,8 @@ def main():
119
119
 
120
120
  trace = run_sampler(steps, args, 10, 2, "halton", conf=conf, trace_file="halton_trace.csv", offset=5)
121
121
  print(trace)
122
+
123
+
122
124
  trace = run_sampler(steps, args, 10, 2, "random", conf=conf, trace_file="random_trace.csv")
123
125
  print(trace)
124
126
 
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
  import codecs
3
3
  import os
4
4
 
5
- VERSION = '0.1.115'
5
+ VERSION = '0.1.118'
6
6
  DESCRIPTION = 'GUI for MG-PSO'
7
7
  LONG_DESCRIPTION = open('../README.md').read()
8
8
 
File without changes