mg-pso-gui 0.1.140__py3-none-any.whl → 0.1.141__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.140
3
+ Version: 0.1.141
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=Np-Lvp2-I_CNm2OzYj25M1kV9Kdf6irXYzWdN69z2X0,23876
4
+ mgpsogui/gui/HomePage.py,sha256=r_daju75mOzuneI9MO9WJo4k9NwD_6MQJJ_Jip0sBtg,24058
5
5
  mgpsogui/gui/OptionManager.py,sha256=36_MlFd6nLt6xd6HHE2sHtL8oW7VBOZbCvJ8er-wWJ4,12544
6
6
  mgpsogui/gui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  mgpsogui/gui/PlatformTab/PlatformTab.py,sha256=KyIoHlMKD9nfQqHeGJwRDA4RCoe4UykjB2l6xMTKK_M,10486
@@ -33,10 +33,10 @@ mgpsogui/gui/images/test.png,sha256=MUnVpRK-isxhEHzx4Q6Yh0M6FRZD1qvgCHH2XmiSBbk,
33
33
  mgpsogui/gui/images/trash.png,sha256=j8cf0kWbJd-4Jp20lUVV1o1NSeQ4v1Ej4gfcIA3DVRQ,2958
34
34
  mgpsogui/gui/images/up.png,sha256=AQvFWCUqSQNaQ1E6LKZ9zNfSvW6t4mgy8uswdg9T2Hg,2457
35
35
  mgpsogui/util/GraphGenerator.py,sha256=KC-qVr4H17rmgfhxZs1P96EEhrBbFgV0vjoTkPvrS9M,15011
36
- mgpsogui/util/PSORunner.py,sha256=MC4K_TjkH1LX0DQ6DtXO-ZjZojjEDegVTaoMUCK4Zok,6018
36
+ mgpsogui/util/PSORunner.py,sha256=Bk6IXsBKSB33uccTJX7xagYwXHLgUbvpcM5qoi1MXHo,6170
37
37
  mgpsogui/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
38
  mgpsogui/util/debug.py,sha256=Swzny9_1S-CCONWGssj9iDoSpbwu5Vr4f95g_9L8bec,19759
39
- mgpsogui/util/helpers.py,sha256=4Whv75Xe_5Qc5GBVfcglfOWsOTsvKmUTytgDcZzBG9s,2009
39
+ mgpsogui/util/helpers.py,sha256=nnRgQ9hCGp5RhyesfT_ZI01CthyuK-VX62yx7ukyTdY,2441
40
40
  mgpsogui/util/sampler_test_driver.py,sha256=1iJTLVFZ_VCsuIdl3mXQBA1GNAH5jJO3z5h4E_bd5U8,3703
41
41
  mgpsogui/util/CTkToolTip/__init__.py,sha256=G1jxV55hGtGgwyC1sR-uUUdasDdh0XZgcI-aILgGYA0,225
42
42
  mgpsogui/util/CTkToolTip/ctk_tooltip.py,sha256=SZMovpQIGvdpDRbqCKl9SHs92DrFCO2MOYL2ifolvOE,6329
@@ -58,8 +58,8 @@ mgpsogui/util/recosu/utils/trace_writer.py,sha256=V9BJlOjCbNYGoXGEk3CF5wjifBxvar
58
58
  mgpsogui/util/recosu/utils/utils.py,sha256=QB8vftq3142ekG0ORjz0ZBHU5YknXbR0oTsrxrPAsF0,3951
59
59
  mgpsogui/util/recosu/utils/plot/__init__.py,sha256=h1KjM7_tNDv351pcwt8A6Ibb1jhwWyx5Gbu-zj-sI3Q,71
60
60
  mgpsogui/util/recosu/utils/plot/cost_steps.py,sha256=1Ce11AJyweWkmvjXPxEygzS-h8yVLmQEDLS53yjPLqQ,3779
61
- mg_pso_gui-0.1.140.dist-info/METADATA,sha256=LDhf585nry7IF4F9BhoO39fb01qP3BW5ixRDEMH0qd4,9460
62
- mg_pso_gui-0.1.140.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
63
- mg_pso_gui-0.1.140.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
64
- mg_pso_gui-0.1.140.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
65
- mg_pso_gui-0.1.140.dist-info/RECORD,,
61
+ mg_pso_gui-0.1.141.dist-info/METADATA,sha256=VXK6Av86Oz3FEX_EUdL76-kvEx3bSsJ81zOwK4Eukf0,9460
62
+ mg_pso_gui-0.1.141.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
63
+ mg_pso_gui-0.1.141.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
64
+ mg_pso_gui-0.1.141.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
65
+ mg_pso_gui-0.1.141.dist-info/RECORD,,
mgpsogui/gui/HomePage.py CHANGED
@@ -546,7 +546,13 @@ class App(customtkinter.CTk):
546
546
 
547
547
  if (os.path.exists(os.path.join(folder, 'error.txt'))):
548
548
 
549
- data = hp.parse_pso_error(os.path.join(folder, 'error.txt'), len(self.option_manager.get_steps()))
549
+
550
+ mode = self.option_manager.get_arguments()['mode'].get()
551
+
552
+ if mode == "Optimization: MG-PSO":
553
+ data = hp.parse_pso_error(os.path.join(folder, 'error.txt'), len(self.option_manager.get_steps()))
554
+ else:
555
+ data = hp.parse_sampling_output(os.path.join(folder, 'output.txt'))
550
556
  self.progress_data = data["data"]
551
557
  self.footer_progress_bar.stop()
552
558
  self.footer_progress_bar.configure(mode="determinate")
@@ -102,34 +102,34 @@ def run_process(stdout_queue, stderr_queue, results_queue, data, folder):
102
102
  print(oh_strategy)
103
103
  print("\n")
104
104
  print(config)
105
- print("\n")
105
+ print("\n", flush=True)
106
106
 
107
107
  if my_mode == "Sampling: Halton":
108
- print("Running Halton Sampling..\n")
108
+ print("Running Halton Sampling..\n", flush=True)
109
109
  trace = run_sampler(steps,
110
110
  args,
111
111
  int(calibration_map['count']),
112
112
  int(calibration_map['num_threads']),
113
113
  "halton",
114
114
  conf=config,
115
- trace_file="halton_trace.csv",
115
+ trace_file=os.path.join(folder, 'halton_trace.txt'),
116
116
  offset=int(calibration_map['offset']))
117
117
  results_queue.put(trace)
118
- print(trace)
118
+ print(trace, flush=True)
119
119
 
120
120
  elif my_mode == "Sampling: Random":
121
- print("Running Random Sampling...\n")
121
+ print("Running Random Sampling...\n", flush=True)
122
122
  trace = run_sampler(steps,
123
123
  args,
124
124
  int(calibration_map['count']),
125
125
  int(calibration_map['num_threads']),
126
126
  "random",
127
127
  conf=config,
128
- trace_file="random_trace.csv")
128
+ trace_file=os.path.join(folder, 'random_trace.txt'))
129
129
  results_queue.put(trace)
130
- print(trace)
130
+ print(trace, flush=True)
131
131
  else:
132
- print("Running MG-PSO Optimization...\n")
132
+ print("Running MG-PSO Optimization...\n", flush=True)
133
133
  optimizer, trace = global_best(steps,
134
134
  rounds=(int(calibration_map['min_rounds']), int(calibration_map['max_rounds'])),
135
135
  args=args,
@@ -142,12 +142,12 @@ def run_process(stdout_queue, stderr_queue, results_queue, data, folder):
142
142
  )
143
143
 
144
144
  results_queue.put(trace)
145
- print(trace)
145
+ print(trace, flush=True)
146
146
 
147
- print("Finishing up...")
147
+ print("Finishing up...", flush=True)
148
148
  time.sleep(5)
149
149
  except Exception as e:
150
- print("An exception occurred: ")
150
+ print("An exception occurred: ", flush=True)
151
151
  print(str(e))
152
152
  # Print stack trace
153
153
  import traceback
mgpsogui/util/helpers.py CHANGED
@@ -21,6 +21,23 @@ def extract_final_round_values(data):
21
21
  final_value["index"] = key
22
22
  return final_value
23
23
 
24
+ def parse_sampling_output(file_path):
25
+ lines = ""
26
+
27
+ with open(file_path, 'r') as f:
28
+ lines = f.readlines()
29
+
30
+ # Remove any lines that don't contain "% Done "
31
+ lines = [line for line in lines if '% Done ' in line]
32
+
33
+ percents = []
34
+ percent = 0
35
+ for line in lines:
36
+ percent = float(line.split('% Done ')[0].strip())
37
+ percents.append(percent)
38
+
39
+ return {"percent": percent, "data": percents}
40
+
24
41
  def parse_pso_error(file_path, num_steps):
25
42
  lines = ""
26
43