mg-pso-gui 0.1.226__py3-none-any.whl → 0.1.228__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.226
3
+ Version: 0.1.228
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=L2Vj2B6BzdXvoi6CkLWgxvtrzRMPJlF2sfbB8VpCVyc,22925
5
- mgpsogui/gui/OptionManager.py,sha256=S7BiDHtCIS8QU0RBqCcsKpzTT9gEjiokizLMSGuD3vw,16353
5
+ mgpsogui/gui/OptionManager.py,sha256=zg1-0mwNLLM_iDAfp5PKlaO6lq2SfdQmZK6qHNfd7Eg,16426
6
6
  mgpsogui/gui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  mgpsogui/gui/PlatformTab/PlatformTab.py,sha256=q8x_tvVgSoyGINuQbivXRThF3gaSSfg8X_dsLSPv4F0,10492
8
8
  mgpsogui/gui/PlatformTab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -12,8 +12,8 @@ mgpsogui/gui/SetupTab/BoundsEditorWindow.py,sha256=U64oaiDIOaimjbqKMz5rQNq2o1SrQ
12
12
  mgpsogui/gui/SetupTab/BoundsList.py,sha256=L77UEaUJNiUE-ZsYIl44tWRb1zBfxaEQ-bAG1V5_IH0,12268
13
13
  mgpsogui/gui/SetupTab/CalibrationParametersView.py,sha256=ppVBHG3nphku9-P6Z8az-HTpgk8vHxnj-A5m80BZTgA,2784
14
14
  mgpsogui/gui/SetupTab/CustomFunctionEditorWindow.py,sha256=yx0dHSNa7fGy99Q6qFcI6j9r8p0DlV3iOBgyPMGd8pM,2884
15
- mgpsogui/gui/SetupTab/CustomFunctionMetrics.py,sha256=JW7lL-PLp-yTJYYLEuYilgraJcKrWvViD6PaWhWpCmU,3902
16
- mgpsogui/gui/SetupTab/FunctionsList.py,sha256=1nAW1ICl2b9D8AAxKZ9G0dVuRTSm8RhfPUTQ4rKF2Vw,6365
15
+ mgpsogui/gui/SetupTab/CustomFunctionMetrics.py,sha256=HHRWdHFuhcFBQ2Gu07j2lFoc7p_T6DOiT_TyKrxmI4M,5777
16
+ mgpsogui/gui/SetupTab/FunctionsList.py,sha256=cMBv87GeRACiJ1DPxFrPvZJOZ3fK6FUVAeUaQCR9dn0,6375
17
17
  mgpsogui/gui/SetupTab/ListEditor.py,sha256=vlP0KDPu8J1_6KXuUTlE7OClgfF0Qk6cISsFm_SglUw,3232
18
18
  mgpsogui/gui/SetupTab/ListParametersView.py,sha256=wYcDcaooYkw-y7XW6dJUwhTWxLuUUOK5tGUFVHBf3ck,7352
19
19
  mgpsogui/gui/SetupTab/OptimalParameterView.py,sha256=VKn-4BlVyqspFIOkbWsM0q9pYVsmqnSND0xP2hDKb60,1785
@@ -62,8 +62,8 @@ mgpsogui/util/recosu/utils/trace_writer.py,sha256=V9BJlOjCbNYGoXGEk3CF5wjifBxvar
62
62
  mgpsogui/util/recosu/utils/utils.py,sha256=QB8vftq3142ekG0ORjz0ZBHU5YknXbR0oTsrxrPAsF0,3951
63
63
  mgpsogui/util/recosu/utils/plot/__init__.py,sha256=h1KjM7_tNDv351pcwt8A6Ibb1jhwWyx5Gbu-zj-sI3Q,71
64
64
  mgpsogui/util/recosu/utils/plot/cost_steps.py,sha256=1Ce11AJyweWkmvjXPxEygzS-h8yVLmQEDLS53yjPLqQ,3779
65
- mg_pso_gui-0.1.226.dist-info/METADATA,sha256=YSQRTzCEvIU3q3KXB0m5jlqkzXrpFgWtWBk9sqesk0M,9456
66
- mg_pso_gui-0.1.226.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
67
- mg_pso_gui-0.1.226.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
68
- mg_pso_gui-0.1.226.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
69
- mg_pso_gui-0.1.226.dist-info/RECORD,,
65
+ mg_pso_gui-0.1.228.dist-info/METADATA,sha256=d030g0MGOA1AP047fsepNzKebIADU6d0tfD1XjYz0Zo,9456
66
+ mg_pso_gui-0.1.228.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
67
+ mg_pso_gui-0.1.228.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
68
+ mg_pso_gui-0.1.228.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
69
+ mg_pso_gui-0.1.228.dist-info/RECORD,,
@@ -130,6 +130,7 @@ class OptionManager():
130
130
  "data": (sv(), sv())}
131
131
  objfunc_obj["name"].set(objfunc["name"])
132
132
  objfunc_obj["of"].set(objfunc["of"])
133
+ objfunc_obj["custom_function_goal"].set("Positive Best")
133
134
 
134
135
  if ("weight" in objfunc):
135
136
  objfunc_obj["weight"].set(objfunc["weight"])
@@ -46,6 +46,38 @@ class CustomFunctionsMetricsView(CTkScrollableFrame):
46
46
  "rmse",
47
47
  "trmse"]
48
48
 
49
+ self.positive_best = {"absdiff": True,
50
+ "absdifflog": True,
51
+ "ave": True,
52
+ "bias": True,
53
+ "fhf": True,
54
+ "ioa": True,
55
+ "ioa2": True,
56
+ "kge": True,
57
+ "kge09": True,
58
+ "mns": True,
59
+ "mse": True,
60
+ "ns": False,
61
+ "ns2log": True,
62
+ "nslog1p": True,
63
+ "nslog2": True,
64
+ "pbias": True,
65
+ "pmcc": True,
66
+ "rmse": True,
67
+ "trmse": True}
68
+
69
+ equation = self.option_manager.get_steps()[self.step_index]["objfunc"][self.functions_index]["custom_function"].get()
70
+ # Example equation (0 * (1 - ns)) + (bias * 0) + (pbias * 0) + (absdiff * 0)
71
+ if equation != "":
72
+ equation = equation.replace("1 - ", "")
73
+ equation = equation.replace("(", "")
74
+ equation = equation.replace(")", "")
75
+ equation = equation.replace(" ", "")
76
+ pairs = equation.split("+")
77
+ for pair in pairs:
78
+ key, value = pair.split("*")
79
+ self.add_key(key, value)
80
+
49
81
  self.render()
50
82
 
51
83
  def clear(self):
@@ -102,4 +134,19 @@ class CustomFunctionsMetricsView(CTkScrollableFrame):
102
134
  row += 1
103
135
 
104
136
  def push_to_option_manager(self):
105
- pass
137
+ equation = ""
138
+
139
+ for key_value in self.key_values:
140
+ name = key_value["name"].get()
141
+ weight = key_value["value"].get()
142
+
143
+ positiveBest = self.positive_best[name]
144
+
145
+ if positiveBest:
146
+ equation += f"({name} * {weight}) + "
147
+ else:
148
+ equation += f"({weight} * (1 - {name})) + "
149
+
150
+ equation = equation[:-3] # Remove the last " + "
151
+
152
+ self.option_manager.get_steps()[self.step_index]["objfunc"][self.functions_index]["custom_function"].set(equation)
@@ -91,7 +91,7 @@ class FunctionsList(CTkFrame):
91
91
  row += 1
92
92
 
93
93
  CTkEntry(self.containerFrame, textvariable=func["custom_function"]).grid(row=row, column=0, columnspan=2, padx=(5, 5), pady=(5, 5), sticky="ew")
94
- CTkOptionMenu(self.containerFrame, values=["+ Best", "0 Best"], variable=func["custom_function_goal"]).grid(row=row, column=2, padx=(5, 5), pady=(5, 5), sticky="ew")
94
+ CTkOptionMenu(self.containerFrame, values=["Positive Best", "Zero Best"], variable=func["custom_function_goal"]).grid(row=row, column=2, padx=(5, 5), pady=(5, 5), sticky="ew")
95
95
 
96
96
  def button_click_event(function_index):
97
97
  dialog = CFEW(title="Edit Custom Function", step_index=self.step_index, function_index=function_index, option_manager=self.option_manager)