mg-pso-gui 0.2.95__py3-none-any.whl → 0.2.97__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.2.95
3
+ Version: 0.2.97
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=_6CWBFHRJrePbJ0iCty4ohPjdZ6SQ7Fl7Gus8FuHpIc,23233
4
+ mgpsogui/gui/HomePage.py,sha256=035xS1y_Z4u9qpohOWvTUAmhcq-8RMXGR5KYCD5wFX8,23610
5
5
  mgpsogui/gui/OptionManager.py,sha256=OczLGSmS9MfE2HgpPNw0OFbl2AdNQ_70pxQUKIDWAnU,21707
6
6
  mgpsogui/gui/OptionManager_backup.py,sha256=TCWfPnHL2foN5id47jsi267lamRG6yGU6y_M29eOOJk,18530
7
7
  mgpsogui/gui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -17,7 +17,7 @@ mgpsogui/gui/SetupTab/BoundsEditorWindow.py,sha256=U64oaiDIOaimjbqKMz5rQNq2o1SrQ
17
17
  mgpsogui/gui/SetupTab/BoundsList.py,sha256=x1D1A0S0EAeKwuA5LFzcqslpws4O1mFUR6bKnuPTDMA,15221
18
18
  mgpsogui/gui/SetupTab/CustomFunctionEditorWindow.py,sha256=yx0dHSNa7fGy99Q6qFcI6j9r8p0DlV3iOBgyPMGd8pM,2884
19
19
  mgpsogui/gui/SetupTab/CustomFunctionMetrics.py,sha256=vOJpElbTgz043m6JYwe9xz_2MBHg985S6KdbJkJERW4,5923
20
- mgpsogui/gui/SetupTab/FunctionsList.py,sha256=ntbIUs8q2Tm3KfBLleT7uL0gynwYuVycwvXv8vude3c,6611
20
+ mgpsogui/gui/SetupTab/FunctionsList.py,sha256=LoHu5FESu6e_QRucNVm8tuSXLl1aLoGYd9r7WOKFTaY,7059
21
21
  mgpsogui/gui/SetupTab/ListEditor.py,sha256=nin7Pl8z7d_yfKoAxM-yVS34uhj-LnprJ2mNRSB7Z0A,3197
22
22
  mgpsogui/gui/SetupTab/ListParametersView.py,sha256=mkGaC5cXhEOy5oD0MbTyK9z7VGZp019oK2Y8Ay-n05Q,7460
23
23
  mgpsogui/gui/SetupTab/OverrideParameterMetrics.py,sha256=rBfaSitYDOajbHvyi2TfoXAHYlz1cCt028UVpIJ_Dc0,3369
@@ -48,7 +48,7 @@ mgpsogui/gui/images/trash.png,sha256=j8cf0kWbJd-4Jp20lUVV1o1NSeQ4v1Ej4gfcIA3DVRQ
48
48
  mgpsogui/gui/images/up.png,sha256=AQvFWCUqSQNaQ1E6LKZ9zNfSvW6t4mgy8uswdg9T2Hg,2457
49
49
  mgpsogui/gui/messages/welcome.txt,sha256=KzN_Zk3vaZeXx-G2KJmd5I7Q1_Shw62E9Fx8U4rQuUQ,5674
50
50
  mgpsogui/util/GraphGenerator.py,sha256=LHHDCvBuJQ0RYQm0azi5tC-etrZ1KLQh-tkahVurPSI,31990
51
- mgpsogui/util/PSORunner.py,sha256=tTe2sF9MRk48dpsNwSn_CbSSNq1laXWMxSZFh_v5FIQ,23115
51
+ mgpsogui/util/PSORunner.py,sha256=6RaIlXHcCloGnAGxS7ukxKgR6Yg831sDfOm4-0ai-gM,23456
52
52
  mgpsogui/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
53
  mgpsogui/util/debug.py,sha256=Swzny9_1S-CCONWGssj9iDoSpbwu5Vr4f95g_9L8bec,19759
54
54
  mgpsogui/util/helpers.py,sha256=Ht2rge_4pGO7halz6KoLsL2eukB0k2tlkx68lBBmBA8,2669
@@ -73,8 +73,8 @@ mgpsogui/util/recosu/utils/trace_writer.py,sha256=V9BJlOjCbNYGoXGEk3CF5wjifBxvar
73
73
  mgpsogui/util/recosu/utils/utils.py,sha256=QB8vftq3142ekG0ORjz0ZBHU5YknXbR0oTsrxrPAsF0,3951
74
74
  mgpsogui/util/recosu/utils/plot/__init__.py,sha256=h1KjM7_tNDv351pcwt8A6Ibb1jhwWyx5Gbu-zj-sI3Q,71
75
75
  mgpsogui/util/recosu/utils/plot/cost_steps.py,sha256=1Ce11AJyweWkmvjXPxEygzS-h8yVLmQEDLS53yjPLqQ,3779
76
- mg_pso_gui-0.2.95.dist-info/METADATA,sha256=woXYXAi8uBQQH_gTxbSxRTt9fdwpy99opYy8a4VR-L4,9455
77
- mg_pso_gui-0.2.95.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
78
- mg_pso_gui-0.2.95.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
79
- mg_pso_gui-0.2.95.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
80
- mg_pso_gui-0.2.95.dist-info/RECORD,,
76
+ mg_pso_gui-0.2.97.dist-info/METADATA,sha256=vxcwuWRqVz-KdIY7YaVujIcL0-9DxXYAj0awRPun2wg,9455
77
+ mg_pso_gui-0.2.97.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
78
+ mg_pso_gui-0.2.97.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
79
+ mg_pso_gui-0.2.97.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
80
+ mg_pso_gui-0.2.97.dist-info/RECORD,,
mgpsogui/gui/HomePage.py CHANGED
@@ -490,6 +490,15 @@ class App(customtkinter.CTk):
490
490
  if not os.path.exists(folder):
491
491
  os.makedirs(folder)
492
492
 
493
+ # Check if crash.txt exists in the folder
494
+ if (os.path.exists(os.path.join(folder, 'crash.txt'))):
495
+ with open(os.path.join(folder, 'crash.txt'), "r") as f:
496
+ message = f.read()
497
+ NW(title="Error Occurred!", message=message)
498
+ # Rename crash.txt to crash_read.txt
499
+ os.rename(os.path.join(folder, 'crash.txt'), os.path.join(folder, 'crash_read.txt'))
500
+ self.stop()
501
+
493
502
  while True:
494
503
  try:
495
504
  stdout_line = stdout_queue.get_nowait()
@@ -43,6 +43,8 @@ class FunctionsList(CTkFrame):
43
43
  self.containerFrame.grid(row=0, column=0, padx=(5, 5), pady=(5, 5), sticky="nsew")
44
44
  self.containerFrame.grid_columnconfigure((0, 1), weight=1)
45
45
 
46
+ mode = self.option_manager.get_mode()
47
+
46
48
  row = 1
47
49
 
48
50
  funcs = self.option_manager.get_steps()[self.step_index]["objective_functions"]
@@ -52,34 +54,36 @@ class FunctionsList(CTkFrame):
52
54
 
53
55
  CTkLabel(self.containerFrame, text="Name:").grid(row=row, column=0, padx=(5, 5), pady=(5, 5), sticky="nsew")
54
56
  CTkLabel(self.containerFrame, text="Objective:").grid(row=row, column=1, padx=(5, 5), pady=(5, 5), sticky="nsew")
55
- CTkLabel(self.containerFrame, text="Weight:").grid(row=row, column=2, padx=(5, 5), pady=(5, 5), sticky="nsew")
57
+ if mode != "Sensitivity Analysis":
58
+ CTkLabel(self.containerFrame, text="Weight:").grid(row=row, column=2, padx=(5, 5), pady=(5, 5), sticky="nsew")
56
59
 
57
60
  row += 1
58
61
 
59
- columns = ["absdiff",
60
- "absdifflog",
61
- "ave",
62
- "bias",
63
- "fhf",
64
- "ioa",
65
- "ioa2",
62
+ columns = ["absdiff (not supported)",
63
+ "absdifflog (not supported)",
64
+ "ave (not supported)",
65
+ "bias (not supported)",
66
+ "fhf (not supported)",
67
+ "ioa (not supported)",
68
+ "ioa2 (not supported)",
66
69
  "kge",
67
- "kge09",
68
- "mns",
69
- "mse",
70
+ "kge09 (not supported)",
71
+ "mns (not supported)",
72
+ "mse (not supported)",
70
73
  "ns",
71
- "ns2log",
74
+ "ns2log (not supported)",
72
75
  "nslog1p",
73
- "nslog2",
76
+ "nslog2 (not supported)",
74
77
  "pbias",
75
- "pmcc",
78
+ "pmcc (not supported)",
76
79
  "rmse",
77
80
  "trmse",
78
81
  "custom"]
79
82
 
80
83
  CTkEntry(self.containerFrame, textvariable=func["name"]).grid(row=row, column=0, padx=(5, 5), pady=(5, 5), sticky="ew")
81
84
  CTkOptionMenu(self.containerFrame, values=columns, variable=func["objective_function"], command=self.refresh).grid(row=row, column=1, padx=(5, 5), pady=(5, 5), sticky="ew")
82
- CTkEntry(self.containerFrame, textvariable=func["weight"]).grid(row=row, column=2, padx=(5, 5), pady=(5, 5), sticky="ew")
85
+ if mode != "Sensitivity Analysis":
86
+ CTkEntry(self.containerFrame, textvariable=func["weight"]).grid(row=row, column=2, padx=(5, 5), pady=(5, 5), sticky="ew")
83
87
 
84
88
  row += 1
85
89
 
@@ -105,14 +109,15 @@ class FunctionsList(CTkFrame):
105
109
 
106
110
  row += 1
107
111
 
108
- CTkLabel(self.containerFrame, text="Observed and Simulated Data:").grid(row=row, column=0, columnspan=3, padx=(5, 5), pady=(5, 5), sticky="nsew")
109
-
110
- row += 1
111
-
112
- CTkEntry(self.containerFrame, textvariable=func["data_observed"]).grid(row=row, column=0, columnspan=3, padx=(5, 5), pady=(5, 5), sticky="nsew")
113
- row += 1
114
- CTkEntry(self.containerFrame, textvariable=func["data_simulated"]).grid(row=row, column=0, columnspan=3, padx=(5, 5), pady=(5, 5), sticky="nsew")
115
- row += 1
112
+ if mode != "Sensitivity Analysis":
113
+ CTkLabel(self.containerFrame, text="Observed and Simulated Data:").grid(row=row, column=0, columnspan=3, padx=(5, 5), pady=(5, 5), sticky="nsew")
114
+
115
+ row += 1
116
+
117
+ CTkEntry(self.containerFrame, textvariable=func["data_observed"]).grid(row=row, column=0, columnspan=3, padx=(5, 5), pady=(5, 5), sticky="nsew")
118
+ row += 1
119
+ CTkEntry(self.containerFrame, textvariable=func["data_simulated"]).grid(row=row, column=0, columnspan=3, padx=(5, 5), pady=(5, 5), sticky="nsew")
120
+ row += 1
116
121
 
117
122
  if self.edit_mode:
118
123
  remove_func = lambda index=index: (self.clear(), self.option_manager.remove_function(self.step_index, index), self.render())
@@ -14,6 +14,19 @@ import shutil
14
14
  import json
15
15
  import numpy as np
16
16
 
17
+ ZERO_BEST = [
18
+ 'rmse',
19
+ 'trmse',
20
+ 'pbias'
21
+ ]
22
+
23
+ POSITIVE_BEST = [
24
+ 'kge',
25
+ 'nslog',
26
+ 'nslog1p',
27
+ 'ns'
28
+ ]
29
+
17
30
  def enqueue_output(out, queue):
18
31
  for line in iter(out.readline, b''):
19
32
  queue.put(line)
@@ -378,6 +391,15 @@ def run_sensitivity_analysis(data, folder, results_queue):
378
391
  for param in output_steps[0]['param']:
379
392
  parameters.append(param['name'])
380
393
 
394
+ positive_best = []
395
+ zero_best = []
396
+
397
+ for obj in output_steps[0]['objfunc']:
398
+ if obj['of'] in POSITIVE_BEST:
399
+ positive_best.append(obj['of'])
400
+ elif obj['of'] in ZERO_BEST:
401
+ zero_best.append(obj['of'])
402
+
381
403
  request_json = {
382
404
  "metainfo": {
383
405
  "service_url": None,
@@ -392,11 +414,11 @@ def run_sensitivity_analysis(data, folder, results_queue):
392
414
  },
393
415
  {
394
416
  "name": "positiveBestMetrics",
395
- "value": ["ns","kge","mns","kge09","nslog2"]
417
+ "value": positive_best
396
418
  },
397
419
  {
398
420
  "name": "zeroBestMetrics",
399
- "value": ["pbias","rmse"]
421
+ "value": zero_best
400
422
  }
401
423
  ]
402
424
  }