mg-pso-gui 0.1.81__py3-none-any.whl → 0.1.84__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.81
3
+ Version: 0.1.84
4
4
  Summary: GUI for MG-PSO
5
5
  Author: Robert Cordingly
6
6
  Author-email: <rcording@uw.ed>
@@ -1,8 +1,8 @@
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=T1WnSBVqjPTYD8QBp8DWloiCYaxwjUQl3rS_REuR0Oc,23983
5
- mgpsogui/gui/OptionManager.py,sha256=u-mXq4ouGJ-oBa71u5GffHwSXHg3Xs32P8RtSgcTmUE,12332
4
+ mgpsogui/gui/HomePage.py,sha256=h8gpQDip-kHmP10zSeqtfeqXQl9Imcv1wBIq-iLtWro,24041
5
+ mgpsogui/gui/OptionManager.py,sha256=H5ofd7PA5f6dVfSghUhKdPiqLHNE0IVpPPzf93k7JD4,12527
6
6
  mgpsogui/gui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  mgpsogui/gui/PlatformTab/PlatformTab.py,sha256=KyIoHlMKD9nfQqHeGJwRDA4RCoe4UykjB2l6xMTKK_M,10486
8
8
  mgpsogui/gui/PlatformTab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -16,9 +16,9 @@ mgpsogui/gui/SetupTab/ListParametersView.py,sha256=wYcDcaooYkw-y7XW6dJUwhTWxLuUU
16
16
  mgpsogui/gui/SetupTab/OptimalParameterView.py,sha256=ItWY0UFQHZ4EGzRXeoyyn4Q_P2GLGy_Ux0THx0ZJSPE,1784
17
17
  mgpsogui/gui/SetupTab/SetupTab.py,sha256=bqb_kgDaTi0oEOjPNBCbdyHaGvCvMRG6LAZ5DXq89vU,2443
18
18
  mgpsogui/gui/SetupTab/StaticParameterView.py,sha256=iEG-UpBBlAJabZo3MG768oLqOROjUPc23tKOSd47IUc,2739
19
- mgpsogui/gui/SetupTab/StepView.py,sha256=oG5Q-3xpTRP1f_PbNvohKctrbpD63zLAJzHD00bN44k,5531
19
+ mgpsogui/gui/SetupTab/StepView.py,sha256=847l_VW_l_7uPJ89kuZsKeqtvp-BEJ3iNg_ROLhmcwQ,5955
20
20
  mgpsogui/gui/SetupTab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
- mgpsogui/gui/VisualizeTab/SideBar.py,sha256=19I6sxi9zobn2jBRfuwMMdn68hwEZvdMn5mi3_aLkxA,13082
21
+ mgpsogui/gui/VisualizeTab/SideBar.py,sha256=TpTY4iFG5TzPMIjxfxREgAxLHvxma3Ihtq_EavWhZq8,13322
22
22
  mgpsogui/gui/VisualizeTab/VisualizeTab.py,sha256=y3ZjLR78yXjHTcHMpB637ipBKxb1CCEM3qzG8OUJvpQ,3477
23
23
  mgpsogui/gui/VisualizeTab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
24
  mgpsogui/gui/images/IGOW 4 Logo.png,sha256=JixNXz5gOEj898VF-_PHthAlGU-6W-y9ucb4EVNPtjs,433752
@@ -33,21 +33,21 @@ 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=HhUsFUFhCv3wTYV8CTqU0wo56Ph9c1DocPj25AVIAdI,15076
36
- mgpsogui/util/PSORunner.py,sha256=qJu8xHojwNZDLamJLw41_Xg2Mp42SUO_cvGb4pia1hw,4637
36
+ mgpsogui/util/PSORunner.py,sha256=xCkt3RSLEsq2BRBiJjfTkWSeGM4oLM1ulT0bjOy_Mkg,3482
37
37
  mgpsogui/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
38
  mgpsogui/util/CTkToolTip/__init__.py,sha256=G1jxV55hGtGgwyC1sR-uUUdasDdh0XZgcI-aILgGYA0,225
39
39
  mgpsogui/util/CTkToolTip/ctk_tooltip.py,sha256=SZMovpQIGvdpDRbqCKl9SHs92DrFCO2MOYL2ifolvOE,6329
40
40
  mgpsogui/util/recosu/__init__.py,sha256=T7_iigIlowGbPOHLO3hwihjw2kbwIg6olOMhFhNiL38,236
41
41
  mgpsogui/util/recosu/pso/__init__.py,sha256=PQ548aEKVOk6MMzxxDg7yMO_1hHfoEoYLLkGLeij73Y,247
42
42
  mgpsogui/util/recosu/pso/csip_access.py,sha256=jBli1MSShUUwQCMKOUvMaGuNwBViCrjXJi_FmSEJsZA,2721
43
- mgpsogui/util/recosu/pso/pso.py,sha256=6e96_f4G6HMRg3FM8xwMfcOqWcEtkBEya6Xv1U0ZU_c,12543
43
+ mgpsogui/util/recosu/pso/pso.py,sha256=dc45ZlysCnqhag5WFyxOMd87a5Xx5r4WDdWcGk_3VNw,12590
44
44
  mgpsogui/util/recosu/utils/__init__.py,sha256=TXz_TpNif2GeGu22pzTnkUQvaP-PmLQ9Sz4BgMIS6ig,196
45
45
  mgpsogui/util/recosu/utils/trace_writer.py,sha256=V9BJlOjCbNYGoXGEk3CF5wjifBxvarrMRXJMbDBWqI8,3023
46
46
  mgpsogui/util/recosu/utils/utils.py,sha256=QB8vftq3142ekG0ORjz0ZBHU5YknXbR0oTsrxrPAsF0,3951
47
47
  mgpsogui/util/recosu/utils/plot/__init__.py,sha256=h1KjM7_tNDv351pcwt8A6Ibb1jhwWyx5Gbu-zj-sI3Q,71
48
48
  mgpsogui/util/recosu/utils/plot/cost_steps.py,sha256=1Ce11AJyweWkmvjXPxEygzS-h8yVLmQEDLS53yjPLqQ,3779
49
- mg_pso_gui-0.1.81.dist-info/METADATA,sha256=4zcVumsKwEallaAku6JFQpI5AQFjHDeTJXtENCy_VQE,9458
50
- mg_pso_gui-0.1.81.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
51
- mg_pso_gui-0.1.81.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
52
- mg_pso_gui-0.1.81.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
53
- mg_pso_gui-0.1.81.dist-info/RECORD,,
49
+ mg_pso_gui-0.1.84.dist-info/METADATA,sha256=8e-O8ENqqpIE2GSm_lb1OvGdIBlcVhYIolrNxr9PmX4,9458
50
+ mg_pso_gui-0.1.84.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
51
+ mg_pso_gui-0.1.84.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
52
+ mg_pso_gui-0.1.84.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
53
+ mg_pso_gui-0.1.84.dist-info/RECORD,,
mgpsogui/gui/HomePage.py CHANGED
@@ -174,7 +174,7 @@ class App(customtkinter.CTk):
174
174
  self.footer_progress_bar.grid(row=0, column=4, padx=(50, 100), pady=header_padding_y, sticky="ew")
175
175
  self.footer_progress_bar.set(0)
176
176
 
177
- self.algorithm_optionmenu = customtkinter.CTkOptionMenu(self.footer_frame, values=["PSO", "Halton"], width=50)
177
+ self.algorithm_optionmenu = customtkinter.CTkOptionMenu(self.footer_frame, textvariable=self.option_manager.get_arguments()['mode'], values=["PSO", "Halton"], width=50)
178
178
  self.algorithm_optionmenu.grid(row=0, column=6, padx=header_padding_x, pady=header_padding_y)
179
179
  self.algorithm_optionmenu.set("PSO")
180
180
 
@@ -11,6 +11,7 @@ class OptionManager():
11
11
  self.project_data = {"name": "", "path": ""}
12
12
  self.arguments = {"param": [],
13
13
  "url": sv(),
14
+ "mode": sv(),
14
15
  "files": {},
15
16
  "calibration_parameters": []}
16
17
  self.steps = []
@@ -19,6 +20,7 @@ class OptionManager():
19
20
  def clear(self):
20
21
  self.arguments['param'].clear()
21
22
  self.arguments['url'].set("")
23
+ self.arguments['mode'].set("PSO")
22
24
  self.arguments['files'] = {}
23
25
  self.arguments['calibration_parameters'].clear()
24
26
  self.steps = []
@@ -29,6 +31,9 @@ class OptionManager():
29
31
  if ("url" in arguments):
30
32
  self.arguments["url"].set(arguments["url"])
31
33
 
34
+ if ("mode" in arguments):
35
+ self.arguments["mode"].set(arguments["mode"])
36
+
32
37
  if ("files" in arguments):
33
38
  for file in arguments["files"]:
34
39
  name = file["name"]
@@ -240,7 +245,7 @@ class OptionManager():
240
245
  result['service_parameters'] = {}
241
246
  result['project_data'] = self.project_data
242
247
  for key, value in self.arguments.items():
243
- if key == 'url':
248
+ if key == 'url' or key == 'mode':
244
249
  result['arguments'][key] = value.get()
245
250
  elif key == 'files':
246
251
  result['arguments'][key] = {}
@@ -64,8 +64,16 @@ class StepView(CTkScrollableFrame):
64
64
  self.containerFrame.grid_columnconfigure((0, 1), weight=1)
65
65
 
66
66
  self.steps = self.option_manager.get_steps()
67
+ self.mode = self.option_manager.get_arguments()['mode'].get()
68
+
69
+ tempSteps = self.steps
70
+ if self.mode == "Halton":
71
+ # Collapse all steps
72
+ tempSteps = []
73
+ if len(self.steps) > 0:
74
+ tempSteps.append(self.steps[0])
67
75
 
68
- for step in self.steps:
76
+ for step in tempSteps:
69
77
 
70
78
  up_image = CTkImage(Image.open(os.path.join("./images", "up.png")), size=(20, 20))
71
79
  down_image = CTkImage(Image.open(os.path.join("./images", "down.png")), size=(20, 20))
@@ -89,9 +97,11 @@ class StepView(CTkScrollableFrame):
89
97
  CTkEntry(self.containerFrame, textvariable=step['name'], width=500).grid(row=row, column=0, padx=(20, 20), pady=(20, 20), sticky="nsw")
90
98
  #CTkLabel(self.containerFrame, textvariable=step['message']).grid(row=row, column=1, padx=(20, 20), pady=(20, 20), sticky="nsew")
91
99
  CTkButton(button_container, width=30, text=None, image=expand_image if not step['open'] else collapse_image, command=expand_func).grid(row=0, column=0, padx=(10, 10), pady=(10, 10), sticky="nsew")
92
- CTkButton(button_container, width=30, text=None, image=up_image, state="disabled" if index==0 else "normal", fg_color="gray" if index==0 else None, command=up_func).grid(row=0, column=1, padx=(10, 10), pady=(10, 10), sticky="nsew")
93
- CTkButton(button_container, width=30, text=None, image=down_image, state="disabled" if index==(len(self.steps)-1) else "normal", fg_color="gray" if index==(len(self.steps)-1) else None, command=down_func).grid(row=0, column=2, padx=(10, 10), pady=(10, 10), sticky="nsew")
94
- CTkButton(button_container, width=30, text=None, image=trash_image, command=remove_func).grid(row=0, column=3, padx=(10, 10), pady=(10, 10), sticky="nsew")
100
+
101
+ if (self.mode == "PSO"):
102
+ CTkButton(button_container, width=30, text=None, image=up_image, state="disabled" if index==0 else "normal", fg_color="gray" if index==0 else None, command=up_func).grid(row=0, column=1, padx=(10, 10), pady=(10, 10), sticky="nsew")
103
+ CTkButton(button_container, width=30, text=None, image=down_image, state="disabled" if index==(len(self.steps)-1) else "normal", fg_color="gray" if index==(len(self.steps)-1) else None, command=down_func).grid(row=0, column=2, padx=(10, 10), pady=(10, 10), sticky="nsew")
104
+ CTkButton(button_container, width=30, text=None, image=trash_image, command=remove_func).grid(row=0, column=3, padx=(10, 10), pady=(10, 10), sticky="nsew")
95
105
 
96
106
  row += 1
97
107
 
@@ -114,5 +124,7 @@ class StepView(CTkScrollableFrame):
114
124
  index += 1
115
125
 
116
126
  # Create an "Add step button that is centered
117
- CTkButton(self.containerFrame, text="Add Group", command=self.create_new_step).grid(
118
- row=row, columnspan=2, column=0, padx=(10, 10), pady=(10, 10), sticky="ew")
127
+
128
+ if (self.mode == "PSO" or len(self.steps) == 0):
129
+ CTkButton(self.containerFrame, text="Add Group", command=self.create_new_step).grid(
130
+ row=row, columnspan=2, column=0, padx=(10, 10), pady=(10, 10), sticky="ew")
@@ -210,6 +210,13 @@ class SideBar(CTkScrollableFrame):
210
210
  with open(file_path, "r") as file:
211
211
  lines = file.readlines()
212
212
 
213
+ if (not lines[0].startswith("@")):
214
+ return {
215
+ "file_attributes": {},
216
+ "data_attributes": {},
217
+ "data": pd.read_csv(file_path)
218
+ }
219
+
213
220
  for line in lines:
214
221
  if (line.startswith("@H,")):
215
222
  mode = "data_metadata"
@@ -87,8 +87,8 @@ def run_process(stdout_queue, stderr_queue, results_queue, cosu_queue, data, fol
87
87
  'async_call': True if calibration_map['async_call'] == "True" else False,
88
88
  'http_conn_timeout': int(calibration_map['conn_timeout']),
89
89
  'http_read_timeout': int(calibration_map['read_timeout']),
90
- 'particles_fail': int(calibration_map['particles_fail']),
91
- 'step_trace': os.path.join(folder, 'trace.json')
90
+ 'particles_fail': int(calibration_map['particles_fail'])
91
+ #,'step_trace': os.path.join(folder, 'trace.json')
92
92
  },
93
93
  result_queue = cosu_queue
94
94
  )
@@ -103,45 +103,4 @@ def run_process(stdout_queue, stderr_queue, results_queue, cosu_queue, data, fol
103
103
  stderr_thread.join()
104
104
 
105
105
  sys.stdout = old_stdout
106
- sys.stderr = old_stderr
107
-
108
- """
109
- def get_results():
110
- request: Client = Client()
111
- for name, value in parameters.items():
112
- # if parameter name has a / in it assume that is a file based parameter and therefore value needs to be an array
113
- if "/" in name and type(value) is not list:
114
- request.add_data(name, [value])
115
- else:
116
- request.add_data(name, value)
117
-
118
- conf = {
119
- 'service_timeout': 60.0 # (sec)
120
- }
121
- files: List[str] = [] #optional list of filenames
122
-
123
- #Synchronous Call
124
- result: Client = request.execute(CSIP_ENDPOINT, files=files, sync=True, conf=conf)
125
-
126
- #Asynchronous Call
127
- tsamp: float = 0
128
- def callback(c: Client, progress: str):
129
- tsamp2: float = time.time()
130
- print('Halton Update {} - {} - {}'.format(halton_id, c.get_status(), tsamp2 - tsamp))
131
-
132
-
133
- tsamp = time.time()
134
- result: Client = request.execute_async(
135
- CSIP_ENDPOINT,
136
- files=files,
137
- callback=callback,
138
- first_poll=poll_time,
139
- next_poll=poll_time,
140
- conf=conf
141
- )
142
- # After recieving response
143
- if result.is_finished():
144
- print(result)
145
- else:
146
- print(result)
147
- """
106
+ sys.stderr = old_stderr
@@ -168,7 +168,7 @@ def global_best(steps: Dict, rounds: Tuple, args: Dict, n_particles: int, iters:
168
168
  step_trace['min_rounds'] = min_rounds
169
169
  step_trace['max_rounds'] = max_rounds
170
170
  step_trace['iters'] = iters
171
- step_trace['ftol'] = ftol
171
+ #step_trace['ftol'] = ftol BUG DOES NOT HANDLE -INF
172
172
  step_trace['ftol_iter'] = ftol_iter
173
173
  step_trace['rtol'] = rtol
174
174
  step_trace['rtol_iter'] = rtol_iter
@@ -176,7 +176,7 @@ def global_best(steps: Dict, rounds: Tuple, args: Dict, n_particles: int, iters:
176
176
  step_trace['n_particles'] = n_particles
177
177
  step_trace['n_steps'] = len(steps)
178
178
  step_trace['steps'] = copy.deepcopy(steps)
179
- step_trace['args'] = args
179
+ #step_trace['args'] = args BUG MUST BE REMOVED
180
180
 
181
181
  if step_file is not None:
182
182
  with open(step_file, "w") as fo: