mg-pso-gui 0.1.108__py3-none-any.whl → 0.1.110__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.108
3
+ Version: 0.1.110
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=SRkYmHwsdmHNomi_lGhBxc1aE3Yr17xr9sdxlAKbiEQ,24244
4
+ mgpsogui/gui/HomePage.py,sha256=_5cCI7RN8hMk4EmWnyaU7JG8EOuHw0mpqC4E1e08Lkw,24054
5
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
@@ -14,7 +14,7 @@ mgpsogui/gui/SetupTab/CalibrationParametersView.py,sha256=ppVBHG3nphku9-P6Z8az-H
14
14
  mgpsogui/gui/SetupTab/FunctionsList.py,sha256=tUqW43VWpxFpdo9UHaPvFQ0CtCo9mFI3mri52ikntrE,4092
15
15
  mgpsogui/gui/SetupTab/ListParametersView.py,sha256=wYcDcaooYkw-y7XW6dJUwhTWxLuUUOK5tGUFVHBf3ck,7352
16
16
  mgpsogui/gui/SetupTab/OptimalParameterView.py,sha256=Z6XuGEVQYa2GlpDe_nxqcXjGoqSaaNkTGKYHzfnsyRg,2003
17
- mgpsogui/gui/SetupTab/SetupTab.py,sha256=bqb_kgDaTi0oEOjPNBCbdyHaGvCvMRG6LAZ5DXq89vU,2443
17
+ mgpsogui/gui/SetupTab/SetupTab.py,sha256=8f_xqmMaD8grmSKFFUHm8zIGEDrSUzU_sNW6CdRLrrE,2436
18
18
  mgpsogui/gui/SetupTab/StaticParameterView.py,sha256=iEG-UpBBlAJabZo3MG768oLqOROjUPc23tKOSd47IUc,2739
19
19
  mgpsogui/gui/SetupTab/StepView.py,sha256=Okmmwpvyu6eu3LO0up8qyUuH8wuQK43kudv1TNNsj8E,5937
20
20
  mgpsogui/gui/SetupTab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -35,20 +35,20 @@ mgpsogui/gui/images/up.png,sha256=AQvFWCUqSQNaQ1E6LKZ9zNfSvW6t4mgy8uswdg9T2Hg,24
35
35
  mgpsogui/util/GraphGenerator.py,sha256=HhUsFUFhCv3wTYV8CTqU0wo56Ph9c1DocPj25AVIAdI,15076
36
36
  mgpsogui/util/PSORunner.py,sha256=Do3-OUH7iZGL6aoCcwsM-6lxof8ERwyKA-_g8rDr_DM,3942
37
37
  mgpsogui/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
- mgpsogui/util/debug.py,sha256=R-OBdE7XH5ejfDGoOHIgKr-TomzFy-jPvUhVzhSbzm0,5159
38
+ mgpsogui/util/debug.py,sha256=Lfbw7tw0udlc2lq0lkMD3ZseCdP4Nsx3STwIP0p_VL4,5255
39
39
  mgpsogui/util/CTkToolTip/__init__.py,sha256=G1jxV55hGtGgwyC1sR-uUUdasDdh0XZgcI-aILgGYA0,225
40
40
  mgpsogui/util/CTkToolTip/ctk_tooltip.py,sha256=SZMovpQIGvdpDRbqCKl9SHs92DrFCO2MOYL2ifolvOE,6329
41
41
  mgpsogui/util/recosu/__init__.py,sha256=T7_iigIlowGbPOHLO3hwihjw2kbwIg6olOMhFhNiL38,236
42
42
  mgpsogui/util/recosu/pso/__init__.py,sha256=PQ548aEKVOk6MMzxxDg7yMO_1hHfoEoYLLkGLeij73Y,247
43
43
  mgpsogui/util/recosu/pso/csip_access.py,sha256=jBli1MSShUUwQCMKOUvMaGuNwBViCrjXJi_FmSEJsZA,2721
44
- mgpsogui/util/recosu/pso/pso.py,sha256=JN4nJcQRw_XAPfdUQSJx60HARCBB5V-hz7toTe_vSbQ,12867
44
+ mgpsogui/util/recosu/pso/pso.py,sha256=iPqT6aI1vi8LYuWmtxuHkLEM9sQwhUznPInBgps7ANI,13708
45
45
  mgpsogui/util/recosu/utils/__init__.py,sha256=TXz_TpNif2GeGu22pzTnkUQvaP-PmLQ9Sz4BgMIS6ig,196
46
46
  mgpsogui/util/recosu/utils/trace_writer.py,sha256=V9BJlOjCbNYGoXGEk3CF5wjifBxvarrMRXJMbDBWqI8,3023
47
47
  mgpsogui/util/recosu/utils/utils.py,sha256=QB8vftq3142ekG0ORjz0ZBHU5YknXbR0oTsrxrPAsF0,3951
48
48
  mgpsogui/util/recosu/utils/plot/__init__.py,sha256=h1KjM7_tNDv351pcwt8A6Ibb1jhwWyx5Gbu-zj-sI3Q,71
49
49
  mgpsogui/util/recosu/utils/plot/cost_steps.py,sha256=1Ce11AJyweWkmvjXPxEygzS-h8yVLmQEDLS53yjPLqQ,3779
50
- mg_pso_gui-0.1.108.dist-info/METADATA,sha256=VBb7hPzzkc0j8xwIyvavBKjoYwT5kFdfymm7zz1Do1Y,9459
51
- mg_pso_gui-0.1.108.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
52
- mg_pso_gui-0.1.108.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
53
- mg_pso_gui-0.1.108.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
54
- mg_pso_gui-0.1.108.dist-info/RECORD,,
50
+ mg_pso_gui-0.1.110.dist-info/METADATA,sha256=r5fak7Cs00IJWlwNsNsaFrDMfd5tPdeuXzSCNv47cMY,9459
51
+ mg_pso_gui-0.1.110.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
52
+ mg_pso_gui-0.1.110.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
53
+ mg_pso_gui-0.1.110.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
54
+ mg_pso_gui-0.1.110.dist-info/RECORD,,
mgpsogui/gui/HomePage.py CHANGED
@@ -330,14 +330,11 @@ class App(customtkinter.CTk):
330
330
 
331
331
  self.optimal_param_frame.clear()
332
332
  self.optimal_param_frame.render()
333
-
334
- info = self.option_manager.get_project_data()
335
- folder = os.path.join(info['path'], info['name'])
336
- self.HRU_data = pd.read_csv(os.path.join(folder, "results", "HRU_1.csv"), skiprows=3)
337
- print(self.HRU_data)
338
333
 
339
334
  self.load_button.configure(text="Loaded!")
340
335
  self.after(3000, lambda: self.load_button.configure(text="Load"))
336
+
337
+ self.make_request()
341
338
 
342
339
  except Exception as e:
343
340
  print(e)
@@ -17,8 +17,8 @@ def create_tab(self, tab):
17
17
  self.paramtabview.grid(row=0, column=1, padx=(0, 0), pady=(10, 10), sticky="nsew")
18
18
 
19
19
  tab1 = "Static"
20
- tab2 = "Calibration"
21
- tab3 = "Optimal Parameters"
20
+ tab2 = "Hyperparameters"
21
+ tab3 = "Optimal"
22
22
  self.paramtabview.add(tab1)
23
23
  self.paramtabview.add(tab2)
24
24
  self.paramtabview.add(tab3)
mgpsogui/util/debug.py CHANGED
@@ -100,6 +100,9 @@ args = {
100
100
 
101
101
  args = {'param': [{'name': 'startTime', 'value': '2002-01-01'}, {'name': 'endTime', 'value': '2006-12-31'}, {'name': 'dataStartTime', 'value': '2002-01-01'}, {'name': 'dataEndTime', 'value': '2006-12-31'}, {'name': 'cal_startTime', 'value': '2003-01-01'}, {'name': 'cal_endTime', 'value': '2006-12-31'}, {'name': 'parallelismThreads', 'value': '2'}, {'name': 'flagLoadState', 'value': 'True'}, {'name': 'payload', 'value': 'false'}, {'name': 'project', 'value': 'SFIR3'}], 'url': 'http://csip.engr.colostate.edu:8087/csip-oms/m/ages/0.3.0', 'mode': 'PSO', 'files': {}}
102
102
 
103
+ if "mode" in args:
104
+ del args["mode"]
105
+
103
106
  # 3. perform optimization
104
107
  optimizer, trace = global_best(steps, # step definition
105
108
  rounds=(1, 2), # min/max number of rounds
@@ -117,6 +120,7 @@ optimizer, trace = global_best(steps, # step definition
117
120
  'async_call': False,
118
121
  'http_conn_timeout': 10,
119
122
  'http_read_timeout': 400,
120
- 'particles_fail': 5
123
+ 'particles_fail': 5,
124
+ 'step_trace': './step_trace.json'
121
125
  }
122
126
  )
@@ -168,7 +168,15 @@ 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 BUG DOES NOT HANDLE -INF
171
+
172
+ # BUG If ftol is -inf set it to a string
173
+ ftol_value = ftol
174
+ if ftol == -np.inf:
175
+ ftol_value = '-inf'
176
+ elif ftol == np.inf:
177
+ ftol_value = 'inf'
178
+
179
+ step_trace['ftol'] = ftol_value
172
180
  step_trace['ftol_iter'] = ftol_iter
173
181
  step_trace['rtol'] = rtol
174
182
  step_trace['rtol_iter'] = rtol_iter
@@ -176,7 +184,7 @@ def global_best(steps: Dict, rounds: Tuple, args: Dict, n_particles: int, iters:
176
184
  step_trace['n_particles'] = n_particles
177
185
  step_trace['n_steps'] = len(steps)
178
186
  step_trace['steps'] = copy.deepcopy(steps)
179
- #step_trace['args'] = args BUG MUST BE REMOVED
187
+ step_trace['args'] = str(args) #BUG MUST BE REMOVED
180
188
 
181
189
  if step_file is not None:
182
190
  with open(step_file, "w") as fo:
@@ -277,7 +285,15 @@ def global_best(steps: Dict, rounds: Tuple, args: Dict, n_particles: int, iters:
277
285
  step_trace[key] = {}
278
286
  step_trace[key]['time'] = str(datetime.datetime.now())
279
287
 
280
- step_trace[key]['best_costs'] = best_cost.tolist() # BUG
288
+ best_costs_list = best_cost.tolist()
289
+ # If the cost is inf, set it to a string
290
+ for i, c in enumerate(best_costs_list):
291
+ if c == np.inf:
292
+ best_costs_list[i] = 'inf'
293
+ elif c == -np.inf:
294
+ best_costs_list[i] = '-inf'
295
+
296
+ step_trace[key]['best_costs'] = best_costs_list # BUG
281
297
  step_trace[key]['steps'] = copy.deepcopy(steps)
282
298
 
283
299
  if step_file is not None:
@@ -314,7 +330,16 @@ def global_best(steps: Dict, rounds: Tuple, args: Dict, n_particles: int, iters:
314
330
  step_trace[key] = {}
315
331
  step_trace[key]['time'] = str(datetime.datetime.now())
316
332
  step_trace[key]['round_cost'] = round_cost
317
- step_trace[key]['best_costs'] = best_cost.tolist()
333
+
334
+ best_costs_list = best_cost.tolist() #BUG
335
+ # If the cost is inf, set it to a string
336
+ for i, c in enumerate(best_costs_list):
337
+ if c == np.inf:
338
+ best_costs_list[i] = 'inf'
339
+ elif c == -np.inf:
340
+ best_costs_list[i] = '-inf'
341
+
342
+ step_trace[key]['best_costs'] = best_costs_list
318
343
  step_trace[key]['improvements'] = no_improvement.tolist()
319
344
  if step_file is not None:
320
345
  with open(step_file, "w") as fo:
@@ -351,7 +376,8 @@ def global_best(steps: Dict, rounds: Tuple, args: Dict, n_particles: int, iters:
351
376
  with open(step_file, "w") as fo:
352
377
  json.dump(step_trace, fo)
353
378
 
354
- result_queue.put("Step Trace")
355
- result_queue.put(step_trace)
379
+ if result_queue is not None:
380
+ result_queue.put("Step Trace")
381
+ result_queue.put(step_trace)
356
382
 
357
383
  return optimizer, step_trace