mg-pso-gui 0.1.129__py3-none-any.whl → 0.1.131__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.129
3
+ Version: 0.1.131
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=cSMX2K0E7MXPlX2IfkpoKh6q6lL_6AhoNgbDexzFRdA,22668
4
+ mgpsogui/gui/HomePage.py,sha256=IRL_lA5J0QCX2LZvxcIt8A4ck9yYZym0mA9NPb9E-iE,23317
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
@@ -36,7 +36,7 @@ mgpsogui/util/GraphGenerator.py,sha256=HhUsFUFhCv3wTYV8CTqU0wo56Ph9c1DocPj25AVIA
36
36
  mgpsogui/util/PSORunner.py,sha256=YmzsZbbTH8axrwJYq7ypCiOeMW4w4dnoLquv1mSGKSU,5729
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=fCfVDaGholx16FVVqf2BhWs9KCevI7aFIve1w2W68EQ,769
39
+ mgpsogui/util/helpers.py,sha256=rG89dG8v2W0U8kuawGWFhxQiJkRzl6A7l7UAM_jHWAk,1995
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
@@ -49,7 +49,7 @@ mgpsogui/util/recosu/sampling/sample_trace_writer.py,sha256=M9w-POLlZgjL5a7J7yxr
49
49
  mgpsogui/util/recosu/sampling/sampler_task.py,sha256=uZobpR83u6xEaUzIknvW9FbB84c2AL7T-5T8O8QIhzY,2776
50
50
  mgpsogui/util/recosu/sampling/sampling.py,sha256=2Z3K26_CL-HSRkdLgFwRp-QTLXPYLxYzynDItKPj8Jk,4138
51
51
  mgpsogui/util/recosu/sampling/halton/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
- mgpsogui/util/recosu/sampling/halton/halton.py,sha256=BzZ9_sOKluPacG5SNwsJnRSJGlTkLPzlJE1xvHIJnxc,1209
52
+ mgpsogui/util/recosu/sampling/halton/halton.py,sha256=Vqwj3mZWcd6WS4slmIx0aA2O67Z4d6zs9haw79lhse0,1210
53
53
  mgpsogui/util/recosu/sampling/halton/prime.py,sha256=gOWJWdFVthmFAt-8Utk856QlJ3IKxBvg9eDfOJOWdr0,4206
54
54
  mgpsogui/util/recosu/sampling/random/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
55
  mgpsogui/util/recosu/sampling/random/random_sampler.py,sha256=cVF2VA40v9h0OSBgwXCKMw4wJGaQnUfBdwVPMffk_9U,905
@@ -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.129.dist-info/METADATA,sha256=Hf8RlQbXKTtCW2by9hi8f-jtxZ_NZCKNqib4c_dweyc,9460
62
- mg_pso_gui-0.1.129.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
63
- mg_pso_gui-0.1.129.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
64
- mg_pso_gui-0.1.129.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
65
- mg_pso_gui-0.1.129.dist-info/RECORD,,
61
+ mg_pso_gui-0.1.131.dist-info/METADATA,sha256=Cuco2yRQJdqdblA2CKpxzfA7-ofp27uS6w-qwnsO0gQ,9460
62
+ mg_pso_gui-0.1.131.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
63
+ mg_pso_gui-0.1.131.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
64
+ mg_pso_gui-0.1.131.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
65
+ mg_pso_gui-0.1.131.dist-info/RECORD,,
mgpsogui/gui/HomePage.py CHANGED
@@ -541,7 +541,17 @@ class App(customtkinter.CTk):
541
541
  print(e)
542
542
 
543
543
  if (os.path.exists(os.path.join(folder, 'error.txt'))):
544
- with open(os.path.join(folder, 'error.txt'), 'r') as f:
544
+
545
+ data = hp.parse_pso_error(os.path.join(folder, 'error.txt'), len(self.option_manager.get_steps()))
546
+ self.progress_data = data["data"]
547
+ self.footer_progress_bar.configure(mode="determinate")
548
+ self.footer_progress_bar.set(data["percent"]/100)
549
+ #self.progress_message_left.configure(text="Percent Complete: " + str(round(data["percent"])) + "%")
550
+ #self.progress_message_middle.configure(text=str(completed_rounds) + "/" + str(total_rounds))
551
+ self.footer_progress_label.configure(text="Round: " + str(data["round"]) + " - Step: " + str(data["step"]))
552
+ #self.progress_message_right.configure(text="Best Cost: " + str(best_cost))
553
+
554
+ """with open(os.path.join(folder, 'error.txt'), 'r') as f:
545
555
  lines = f.readlines()
546
556
  lines_string = "".join(lines)
547
557
  self.data_cache = lines_string
@@ -585,7 +595,7 @@ class App(customtkinter.CTk):
585
595
  self.progress_message_left.configure(text="")
586
596
  self.progress_message_middle.configure(text="Starting new round...")
587
597
  self.footer_progress_label.configure(text="Next round...")
588
- self.progress_message_right.configure(text="")
598
+ self.progress_message_right.configure(text="")"""
589
599
 
590
600
 
591
601
 
mgpsogui/util/helpers.py CHANGED
@@ -19,4 +19,50 @@ def extract_final_round_values(data):
19
19
  round_steps.append(step_obj)
20
20
  final_value["data"] = round_steps
21
21
  final_value["index"] = key
22
- return final_value
22
+ return final_value
23
+
24
+ def parse_pso_error(file_path, num_steps):
25
+ lines = ""
26
+
27
+ with open(file_path, 'r') as f:
28
+ lines = f.readlines()
29
+
30
+ lines = [line for line in lines if 'best_cost' in line]
31
+ lines = [line.replace("pyswarms.single.global_best: ", "") for line in lines]
32
+
33
+ round = 1
34
+ step = 1
35
+
36
+ round_steps = {}
37
+ percents = []
38
+ best_costs = []
39
+ in100s = False
40
+ percent = 0
41
+ for line in lines:
42
+ best_cost = float(line.split('best_cost=')[1].strip())
43
+ percent = float(line.split('%')[0].strip())
44
+
45
+ best_costs.append(best_cost)
46
+ percents.append(percent)
47
+
48
+ # Percent is less than last percent or we are at the end of the file
49
+ if (percent == 100 and not in100s):
50
+ in100s = True
51
+
52
+ round_steps[f"Round: {round} - Step: {step}"] = {
53
+ "best_cost": best_costs,
54
+ "percent": percents
55
+ }
56
+
57
+ best_costs = []
58
+ percents = []
59
+
60
+ step += 1
61
+ if step > num_steps:
62
+ step = 1
63
+ round += 1
64
+
65
+ if percent != 100:
66
+ in100s = False
67
+
68
+ return {"round": round, "step": step, "percent": percent, "data": round_steps}
@@ -1,6 +1,6 @@
1
1
  from collections.abc import Iterable
2
2
  import math
3
- from ..sampling.halton.prime import generate_n_primes
3
+ from ...sampling.halton.prime import generate_n_primes
4
4
 
5
5
 
6
6
  def halton(index: int, base: int) -> float: