mg-pso-gui 0.1.120__py3-none-any.whl → 0.1.122__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.120
3
+ Version: 0.1.122
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=fsEYYsO-M6cbAOfAKHKNIpJfbB127ZVlWXfXFeRJN8o,22573
4
+ mgpsogui/gui/HomePage.py,sha256=cSMX2K0E7MXPlX2IfkpoKh6q6lL_6AhoNgbDexzFRdA,22668
5
5
  mgpsogui/gui/OptionManager.py,sha256=36_MlFd6nLt6xd6HHE2sHtL8oW7VBOZbCvJ8er-wWJ4,12544
6
6
  mgpsogui/gui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  mgpsogui/gui/PlatformTab/PlatformTab.py,sha256=KyIoHlMKD9nfQqHeGJwRDA4RCoe4UykjB2l6xMTKK_M,10486
@@ -33,7 +33,7 @@ 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=ZXFpfL1U8PxRwMDtuHmXHdJclzounq0mCJ0YOVEBtm4,3934
36
+ mgpsogui/util/PSORunner.py,sha256=qMcgyckfcV7bcTzXHLoduAJ06Wg2qROouu7vT9uaK4A,5728
37
37
  mgpsogui/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
38
  mgpsogui/util/debug.py,sha256=Swzny9_1S-CCONWGssj9iDoSpbwu5Vr4f95g_9L8bec,19759
39
39
  mgpsogui/util/helpers.py,sha256=fCfVDaGholx16FVVqf2BhWs9KCevI7aFIve1w2W68EQ,769
@@ -49,8 +49,8 @@ mgpsogui/util/recosu/utils/trace_writer.py,sha256=V9BJlOjCbNYGoXGEk3CF5wjifBxvar
49
49
  mgpsogui/util/recosu/utils/utils.py,sha256=QB8vftq3142ekG0ORjz0ZBHU5YknXbR0oTsrxrPAsF0,3951
50
50
  mgpsogui/util/recosu/utils/plot/__init__.py,sha256=h1KjM7_tNDv351pcwt8A6Ibb1jhwWyx5Gbu-zj-sI3Q,71
51
51
  mgpsogui/util/recosu/utils/plot/cost_steps.py,sha256=1Ce11AJyweWkmvjXPxEygzS-h8yVLmQEDLS53yjPLqQ,3779
52
- mg_pso_gui-0.1.120.dist-info/METADATA,sha256=VCRyQq7JpVEA2VUbXCeYjgSCKeepT3-IzDINAMXAnM0,9460
53
- mg_pso_gui-0.1.120.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
54
- mg_pso_gui-0.1.120.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
55
- mg_pso_gui-0.1.120.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
56
- mg_pso_gui-0.1.120.dist-info/RECORD,,
52
+ mg_pso_gui-0.1.122.dist-info/METADATA,sha256=URzxA1kwKRyErmBgKMDlKqnVUxG9vMl0c_JGR4YV-4g,9460
53
+ mg_pso_gui-0.1.122.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
54
+ mg_pso_gui-0.1.122.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
55
+ mg_pso_gui-0.1.122.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
56
+ mg_pso_gui-0.1.122.dist-info/RECORD,,
mgpsogui/gui/HomePage.py CHANGED
@@ -306,7 +306,7 @@ class App(customtkinter.CTk):
306
306
  def make_request(self):
307
307
  service_url = self.service_url.get()
308
308
  try:
309
- response = requests.get(service_url, timeout=1)
309
+ response = requests.get(service_url, timeout=5)
310
310
 
311
311
  response_json = json.loads(response.text)
312
312
  status = response.status_code
@@ -325,6 +325,7 @@ class App(customtkinter.CTk):
325
325
  self.refresh_button.configure(fg_color="green")
326
326
  except Exception as e:
327
327
  self.refresh_button.configure(fg_color="red")
328
+ self.after(1000, lambda: self.refresh_button.configure(fg_color=self.default_button_color))
328
329
 
329
330
 
330
331
  def load(self):
@@ -5,6 +5,7 @@ from queue import Empty
5
5
  import threading
6
6
  import time
7
7
  import os
8
+ from .recosu.sampling.sampler import run_sampler
8
9
 
9
10
  #from cosu.pso import global_best
10
11
  from .recosu.pso import global_best
@@ -19,6 +20,8 @@ def run_process(stdout_queue, stderr_queue, results_queue, data, folder):
19
20
  args = data['arguments']
20
21
  calib = data['calibration_parameters']
21
22
 
23
+ my_mode = args["mode"]
24
+
22
25
  # If "mode" in args remove it
23
26
  if "mode" in args:
24
27
  del args["mode"]
@@ -76,6 +79,18 @@ def run_process(stdout_queue, stderr_queue, results_queue, data, folder):
76
79
  'step_trace': os.path.join(folder, 'pso_step_trace.json')
77
80
  }
78
81
 
82
+ if my_mode == "Sampling: Halton" or my_mode == "Sampling: Random":
83
+ config = {
84
+ 'service_timeout': int(calibration_map['service_timeout']),
85
+ 'http_retry': int(calibration_map['http_retry']),
86
+ 'allow_redirects': True if calibration_map['allow_redirects'] == "True" else False,
87
+ 'async_call': True if calibration_map['async_call'] == "True" else False,
88
+ 'conn_timeout': int(calibration_map['conn_timeout']),
89
+ 'read_timeout': int(calibration_map['read_timeout']),
90
+ 'particles_fail': int(calibration_map['particles_fail']),
91
+ 'step_trace': os.path.join(folder, 'pso_step_trace.json')
92
+ }
93
+
79
94
  print("\n")
80
95
  print(steps)
81
96
  print("\n")
@@ -92,20 +107,43 @@ def run_process(stdout_queue, stderr_queue, results_queue, data, folder):
92
107
 
93
108
  print("Running global_best...\n")
94
109
 
95
- optimizer, trace = global_best(steps,
96
- rounds=(int(calibration_map['min_rounds']), int(calibration_map['max_rounds'])),
97
- args=args,
98
- n_particles=int(calibration_map['n_particles']),
99
- iters=int(calibration_map['iters']),
100
- n_threads=int(calibration_map['n_threads']),
101
- # ftol=0.00000001,
102
- options=options,
103
- oh_strategy=oh_strategy,
104
- conf=config
105
- )
106
-
107
- results_queue.put(trace)
108
- print(trace)
110
+ if my_mode == "Sampling: Halton":
111
+ trace = run_sampler(steps,
112
+ args,
113
+ int(calibration_map['count']),
114
+ int(calibration_map['num_threads']),
115
+ "halton",
116
+ conf=config,
117
+ trace_file="halton_trace.csv",
118
+ offset=int(calibration_map['offset']))
119
+ results_queue.put(trace)
120
+ print(trace)
121
+
122
+ elif my_mode == "Sampling: Random":
123
+ trace = run_sampler(steps,
124
+ args,
125
+ int(calibration_map['count']),
126
+ int(calibration_map['num_threads']),
127
+ "random",
128
+ conf=config,
129
+ trace_file="random_trace.csv")
130
+ results_queue.put(trace)
131
+ print(trace)
132
+ else:
133
+
134
+ optimizer, trace = global_best(steps,
135
+ rounds=(int(calibration_map['min_rounds']), int(calibration_map['max_rounds'])),
136
+ args=args,
137
+ n_particles=int(calibration_map['n_particles']),
138
+ iters=int(calibration_map['iters']),
139
+ n_threads=int(calibration_map['n_threads']),
140
+ options=options,
141
+ oh_strategy=oh_strategy,
142
+ conf=config
143
+ )
144
+
145
+ results_queue.put(trace)
146
+ print(trace)
109
147
 
110
148
  print("Finishing up...")
111
149
  time.sleep(5)