mg-pso-gui 0.1.55__py3-none-any.whl → 0.1.58__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.55
3
+ Version: 0.1.58
4
4
  Summary: GUI for MG-PSO
5
5
  Author: Robert Cordingly
6
6
  Author-email: <rcording@uw.ed>
@@ -2,7 +2,7 @@ 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
4
  mgpsogui/gui/HomePage.py,sha256=JF4bSw84lfUgjGT3jLY2WcJHix4NccL6vIgEqNENxkY,23403
5
- mgpsogui/gui/OptionManager.py,sha256=bFN2jWJbx1Din3waOFLmbWGt0BXD_KthGJ8Mgue_FEE,11712
5
+ mgpsogui/gui/OptionManager.py,sha256=u-mXq4ouGJ-oBa71u5GffHwSXHg3Xs32P8RtSgcTmUE,12332
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
@@ -13,7 +13,8 @@ mgpsogui/gui/SetupTab/BoundsList.py,sha256=L77UEaUJNiUE-ZsYIl44tWRb1zBfxaEQ-bAG1
13
13
  mgpsogui/gui/SetupTab/CalibrationParametersView.py,sha256=ppVBHG3nphku9-P6Z8az-HTpgk8vHxnj-A5m80BZTgA,2784
14
14
  mgpsogui/gui/SetupTab/FunctionsList.py,sha256=tUqW43VWpxFpdo9UHaPvFQ0CtCo9mFI3mri52ikntrE,4092
15
15
  mgpsogui/gui/SetupTab/ListParametersView.py,sha256=wYcDcaooYkw-y7XW6dJUwhTWxLuUUOK5tGUFVHBf3ck,7352
16
- mgpsogui/gui/SetupTab/SetupTab.py,sha256=Doy_6xLq1BjhLTFHRQm7CAbpQzUnNJW4KkBcdfrxWoE,1881
16
+ mgpsogui/gui/SetupTab/OptimalParameterView.py,sha256=_sRBN4eI64o0qPzkFBts-8q4q8-HI0a9kkweH6nvyb4,1818
17
+ mgpsogui/gui/SetupTab/SetupTab.py,sha256=dNCakUtnFefA9nsRJciN6D_2i5llqSEofHHu0iSsbjM,2432
17
18
  mgpsogui/gui/SetupTab/StaticParameterView.py,sha256=iEG-UpBBlAJabZo3MG768oLqOROjUPc23tKOSd47IUc,2739
18
19
  mgpsogui/gui/SetupTab/StepView.py,sha256=oG5Q-3xpTRP1f_PbNvohKctrbpD63zLAJzHD00bN44k,5531
19
20
  mgpsogui/gui/SetupTab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -31,7 +32,7 @@ mgpsogui/gui/images/stop.png,sha256=JPuxXQerCGpLikcp7cAj3iLCOjULMYYZ2sZe0lArh68,
31
32
  mgpsogui/gui/images/test.png,sha256=MUnVpRK-isxhEHzx4Q6Yh0M6FRZD1qvgCHH2XmiSBbk,3642
32
33
  mgpsogui/gui/images/trash.png,sha256=j8cf0kWbJd-4Jp20lUVV1o1NSeQ4v1Ej4gfcIA3DVRQ,2958
33
34
  mgpsogui/gui/images/up.png,sha256=AQvFWCUqSQNaQ1E6LKZ9zNfSvW6t4mgy8uswdg9T2Hg,2457
34
- mgpsogui/util/GraphGenerator.py,sha256=4_l3D8xESegVmKc8O9mS4GIj4KjxJkh0oauBst7CXAg,14708
35
+ mgpsogui/util/GraphGenerator.py,sha256=024tgb7Yk1Hy64lUbYX0jz437ghrHmCiivKGteXcwKg,15012
35
36
  mgpsogui/util/PSORunner.py,sha256=wfkrZLysgSS_5BrdFEm8U-0S7DHYpxmHPau_Ec5W8ak,4510
36
37
  mgpsogui/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
38
  mgpsogui/util/CTkToolTip/__init__.py,sha256=G1jxV55hGtGgwyC1sR-uUUdasDdh0XZgcI-aILgGYA0,225
@@ -45,8 +46,8 @@ mgpsogui/util/recosu/utils/trace_writer.py,sha256=V9BJlOjCbNYGoXGEk3CF5wjifBxvar
45
46
  mgpsogui/util/recosu/utils/utils.py,sha256=QB8vftq3142ekG0ORjz0ZBHU5YknXbR0oTsrxrPAsF0,3951
46
47
  mgpsogui/util/recosu/utils/plot/__init__.py,sha256=h1KjM7_tNDv351pcwt8A6Ibb1jhwWyx5Gbu-zj-sI3Q,71
47
48
  mgpsogui/util/recosu/utils/plot/cost_steps.py,sha256=1Ce11AJyweWkmvjXPxEygzS-h8yVLmQEDLS53yjPLqQ,3779
48
- mg_pso_gui-0.1.55.dist-info/METADATA,sha256=rowjRbwyjHeFeePd_7fJHJYBGEviJatWkswPl624JpA,9458
49
- mg_pso_gui-0.1.55.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
50
- mg_pso_gui-0.1.55.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
51
- mg_pso_gui-0.1.55.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
52
- mg_pso_gui-0.1.55.dist-info/RECORD,,
49
+ mg_pso_gui-0.1.58.dist-info/METADATA,sha256=7cH-WEHXtEYyIofcY5XOKwFvg9MFjmfF3GXdz_lcXmw,9458
50
+ mg_pso_gui-0.1.58.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
51
+ mg_pso_gui-0.1.58.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
52
+ mg_pso_gui-0.1.58.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
53
+ mg_pso_gui-0.1.58.dist-info/RECORD,,
@@ -65,6 +65,7 @@ class OptionManager():
65
65
  "name": sv(),
66
66
  "bounds": (sv(), sv()),
67
67
  "default_value": sv(),
68
+ "optimal_value": sv(),
68
69
  "type": sv(),
69
70
  "calibration_strategy": sv()
70
71
  }
@@ -75,18 +76,27 @@ class OptionManager():
75
76
  else:
76
77
  param_obj["bounds"][0].set(0)
77
78
  param_obj["bounds"][1].set(1)
79
+
78
80
  if "type" in param:
79
81
  param_obj["type"].set(param["type"])
80
82
  else:
81
83
  param_obj["type"].set("float")
84
+
82
85
  if "default_value" in param:
83
86
  param_obj["default_value"].set(param["default_value"])
84
87
  else:
85
88
  param_obj["default_value"].set(1)
89
+
90
+ if "optimal_value" in param:
91
+ param_obj["optimal_value"].set(param["optimal_value"])
92
+ else:
93
+ param_obj["optimal_value"].set(0)
94
+
86
95
  if "calibration_strategy" in param:
87
96
  param_obj["calibration_strategy"].set(param["calibration_strategy"])
88
97
  else:
89
98
  param_obj["calibration_strategy"].set("none")
99
+
90
100
  obj["param"].append(param_obj)
91
101
 
92
102
  for objfunc in step["objfunc"]:
@@ -135,17 +145,20 @@ class OptionManager():
135
145
  max=1,
136
146
  type="float",
137
147
  default_value=1,
148
+ optimal_value=0,
138
149
  calibration_strategy="none"):
139
150
  obj = {
140
151
  "name": sv(),
141
152
  "bounds": (sv(), sv()),
142
153
  "default_value": sv(),
154
+ "optimal_value": sv(),
143
155
  "type": sv(),
144
156
  "calibration_strategy": sv()
145
157
  }
146
158
  obj["name"].set(name)
147
159
  obj["type"].set(type)
148
160
  obj["default_value"].set(default_value)
161
+ obj["optimal_value"].set(optimal_value)
149
162
  obj["calibration_strategy"].set(calibration_strategy)
150
163
  obj["bounds"][0].set(min)
151
164
  obj["bounds"][1].set(max)
@@ -257,6 +270,7 @@ class OptionManager():
257
270
  'bounds': (float(param['bounds'][0].get()),
258
271
  float(param['bounds'][1].get())),
259
272
  'default_value': float(param['default_value'].get()),
273
+ 'optimal_value': float(param['optimal_value'].get()),
260
274
  'type': 'float',
261
275
  'calibration_strategy': param['calibration_strategy'].get()
262
276
  }
@@ -268,6 +282,7 @@ class OptionManager():
268
282
  'bounds': (float(param['bounds'][0].get()),
269
283
  float(param['bounds'][1].get())),
270
284
  'default_value': param['default_value'].get(),
285
+ 'optimal_value': param['optimal_value'].get(),
271
286
  'type': 'list',
272
287
  'calibration_strategy': param['calibration_strategy'].get()
273
288
  }
@@ -0,0 +1,49 @@
1
+ from customtkinter import CTkScrollableFrame
2
+ from customtkinter import CTkFrame
3
+ from customtkinter import CTkLabel
4
+ from customtkinter import CTkButton
5
+ from customtkinter import CTkEntry
6
+ import tkinter as tk
7
+
8
+ global option_manager
9
+
10
+ class OptimalParameterView(CTkScrollableFrame):
11
+ def __init__(self, *args,
12
+ option_manager: None,
13
+ **kwargs):
14
+ super().__init__(*args, **kwargs)
15
+
16
+ self.option_manager = option_manager
17
+
18
+ self.render()
19
+
20
+ def clear(self):
21
+ self.containerFrame.destroy()
22
+
23
+ def render(self):
24
+ row = 0
25
+ index = 0
26
+
27
+ self.containerFrame = CTkFrame(self)
28
+ self.containerFrame.grid(row=0, column=0, padx=(5, 5), pady=(5, 5), sticky="nsew")
29
+ self.containerFrame.grid_columnconfigure((0, 1), weight=1)
30
+
31
+ CTkLabel(self.containerFrame, text="Name:").grid(row=row, column=0, columnspan=1, padx=5, pady=5, sticky="")
32
+ CTkLabel(self.containerFrame, text="Value:").grid(row=row, column=1, columnspan=1, padx=5, pady=5, sticky="")
33
+ row += 1
34
+
35
+ self.steps = self.option_manager.get_steps()
36
+
37
+ for step in self.steps:
38
+ name = step['name'].get()
39
+ CTkLabel(self.containerFrame, text=name).grid(row=row, column=0, columnspan=1, padx=5, pady=5, sticky="")
40
+ row += 1
41
+
42
+ for param in step['param']:
43
+ CTkEntry(self.containerFrame, textvariable=param['name']).grid(row=row, column=0, padx=(5, 5), pady=(5, 5), sticky="ew")
44
+
45
+ bb = CTkEntry(self.containerFrame)
46
+ bb.grid(row=row, column=1, padx=(5, 5), pady=(5, 5), sticky="ew")
47
+ bb.configure(textvariable=param['optimal_value'])
48
+ row += 1
49
+ index += 1
@@ -3,6 +3,7 @@
3
3
  from . import StepView as sv
4
4
  from . import StaticParameterView as spv
5
5
  from . import CalibrationParametersView as cpv
6
+ from . import OptimalParameterView as opv
6
7
 
7
8
  import customtkinter
8
9
 
@@ -15,10 +16,12 @@ def create_tab(self, tab):
15
16
  self.paramtabview = customtkinter.CTkTabview(tab, bg_color="transparent", fg_color="transparent")
16
17
  self.paramtabview.grid(row=0, column=1, padx=(0, 0), pady=(10, 10), sticky="nsew")
17
18
 
18
- tab1 = "Static Parameters"
19
- tab2 = "Calibration Parameters"
19
+ tab1 = "Static"
20
+ tab2 = "Calibration"
21
+ tab3 = "Optimal"
20
22
  self.paramtabview.add(tab1)
21
23
  self.paramtabview.add(tab2)
24
+ self.paramtabview.add(tab3)
22
25
 
23
26
  self.paramtabview.tab(tab1).grid_columnconfigure(0, weight=1)
24
27
  self.paramtabview.tab(tab1).grid_rowconfigure(0, weight=1)
@@ -26,12 +29,20 @@ def create_tab(self, tab):
26
29
  self.paramtabview.tab(tab2).grid_columnconfigure(0, weight=1)
27
30
  self.paramtabview.tab(tab2).grid_rowconfigure(0, weight=1)
28
31
 
32
+ self.paramtabview.tab(tab3).grid_columnconfigure(0, weight=1)
33
+ self.paramtabview.tab(tab3).grid_rowconfigure(0, weight=1)
34
+
29
35
  self.static_param_frame = spv.StaticParameterView(self.paramtabview.tab(tab1), option_manager=self.option_manager)
30
36
  self.static_param_frame.grid(row=0, column=0, padx=(10, 10), pady=(10, 0), sticky="nsew")
31
37
  self.static_param_frame.grid_columnconfigure(0, weight=1)
32
38
  self.static_param_frame.grid_rowconfigure(0, weight=1)
33
39
 
34
- self.calib_param_frame = cpv.CalibrationParametersView(self.paramtabview.tab(tab2), option_manager=self.option_manager)
40
+ self.optimal_param_frame = cpv.CalibrationParametersView(self.paramtabview.tab(tab2), option_manager=self.option_manager)
41
+ self.optimal_param_frame.grid(row=0, column=0, padx=(10, 10), pady=(10, 0), sticky="nsew")
42
+ self.optimal_param_frame.grid_columnconfigure(0, weight=1)
43
+ self.optimal_param_frame.grid_rowconfigure(0, weight=1)
44
+
45
+ self.calib_param_frame = opv.OptimalParameterView(self.paramtabview.tab(tab3), option_manager=self.option_manager)
35
46
  self.calib_param_frame.grid(row=0, column=0, padx=(10, 10), pady=(10, 0), sticky="nsew")
36
47
  self.calib_param_frame.grid_columnconfigure(0, weight=1)
37
48
  self.calib_param_frame.grid_rowconfigure(0, weight=1)
@@ -289,20 +289,23 @@ def custom_csv(homepage, option_manager):
289
289
  val = homepage.csv_y1_selector.get()
290
290
  val2 = homepage.csv_y2_selector.get()
291
291
 
292
+ data_start_index = 2
293
+
292
294
  xx = None
293
295
  if x == "time":
294
- xx = pd.to_datetime(data["time"], format='%Y-%m-%d', errors='coerce').iloc[2:]
296
+ xx = pd.to_datetime(data["time"], format='%Y-%m-%d', errors='coerce').iloc[data_start_index:]
295
297
  elif x == "date":
296
- xx = pd.to_datetime(data["date"], format='%d-%m-%Y', errors='coerce').iloc[2:]
298
+ data_start_index = 5
299
+ xx = pd.to_datetime(data["date"], format='%d-%m-%Y', errors='coerce').iloc[data_start_index:]
297
300
  else:
298
- xx = pd.to_numeric(data[x], errors="coerce").iloc[2:]
301
+ xx = pd.to_numeric(data[x], errors="coerce").iloc[data_start_index:]
299
302
 
300
- yy = pd.to_numeric(data[val], errors="coerce").iloc[2:]
303
+ yy = pd.to_numeric(data[val], errors="coerce").iloc[data_start_index:]
301
304
 
302
305
  #yy_unit = "N/A"
303
306
  yy_unit = data[val].iloc[1]
304
307
 
305
- yy2 = pd.to_numeric(data[val2], errors="coerce").iloc[2:]
308
+ yy2 = pd.to_numeric(data[val2], errors="coerce").iloc[data_start_index:]
306
309
 
307
310
  #yy2_unit = "N/A"
308
311
  yy2_unit = data[val2].iloc[1]
@@ -360,30 +363,33 @@ def compare_csv(homepage, option_manager):
360
363
  val = homepage.csv_y1_selector.get()
361
364
  val2 = homepage.csv_y2_selector.get()
362
365
 
366
+ data_start_index = 2
367
+ data_start_index2 = 2
368
+
363
369
  xx = None
364
370
  if x == "time":
365
- xx = pd.to_datetime(data["time"], format='%Y-%m-%d', errors='coerce').iloc[2:]
371
+ xx = pd.to_datetime(data["time"], format='%Y-%m-%d', errors='coerce').iloc[data_start_index:]
366
372
  elif x == "date":
367
- xx = pd.to_datetime(data["date"], format='%d-%m-%Y', errors='coerce').iloc[2:]
373
+ data_start_index = 5
374
+ xx = pd.to_datetime(data["date"], format='%d-%m-%Y', errors='coerce').iloc[data_start_index:]
368
375
  else:
369
- xx = pd.to_numeric(data[x], errors="coerce").iloc[2:]
376
+ xx = pd.to_numeric(data[x], errors="coerce").iloc[data_start_index:]
370
377
 
371
- yy = pd.to_numeric(data[val], errors="coerce").iloc[2:]
378
+ yy = pd.to_numeric(data[val], errors="coerce").iloc[data_start_index:]
372
379
 
373
380
  xx2 = None
374
381
  if x == "time":
375
- xx2 = pd.to_datetime(data2["time"], format='%Y-%m-%d', errors='coerce').iloc[2:]
382
+ xx2 = pd.to_datetime(data2["time"], format='%Y-%m-%d', errors='coerce').iloc[data_start_index2:]
376
383
  elif x == "date":
377
- xx2 = pd.to_datetime(data2["date"], format='%d-%m-%Y', errors='coerce').iloc[2:]
384
+ data_start_index2 = 5
385
+ xx2 = pd.to_datetime(data2["date"], format='%d-%m-%Y', errors='coerce').iloc[data_start_index2:]
378
386
  else:
379
- xx2 = pd.to_numeric(data2[x], errors="coerce").iloc[2:]
380
-
381
- yy = pd.to_numeric(data[val], errors="coerce").iloc[2:]
387
+ xx2 = pd.to_numeric(data2[x], errors="coerce").iloc[data_start_index2:]
382
388
 
383
389
  #yy_unit = "N/A"
384
390
  yy_unit = data[val].iloc[1]
385
391
 
386
- yy2 = pd.to_numeric(data2[val2], errors="coerce").iloc[2:]
392
+ yy2 = pd.to_numeric(data2[val2], errors="coerce").iloc[data_start_index2:]
387
393
 
388
394
  #yy2_unit = "N/A"
389
395
  yy2_unit = data2[val2].iloc[1]