mg-pso-gui 0.1.99__py3-none-any.whl → 0.1.101__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.99
3
+ Version: 0.1.101
4
4
  Summary: GUI for MG-PSO
5
5
  Author: Robert Cordingly
6
6
  Author-email: <rcording@uw.ed>
@@ -33,8 +33,9 @@ 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=EsieesahV022aDLFfC_DfPILjvx3crJ8e3BZw_EJm6o,3437
36
+ mgpsogui/util/PSORunner.py,sha256=QQuZJlACioHsvPUNthIdR3AHadAoOX7RtQwrwXIpVoY,3320
37
37
  mgpsogui/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
+ mgpsogui/util/debug.py,sha256=JuEmIyGB8XDIkSg_EmpBmerAU_v6DVf9H3NsGXtit7k,3674
38
39
  mgpsogui/util/CTkToolTip/__init__.py,sha256=G1jxV55hGtGgwyC1sR-uUUdasDdh0XZgcI-aILgGYA0,225
39
40
  mgpsogui/util/CTkToolTip/ctk_tooltip.py,sha256=SZMovpQIGvdpDRbqCKl9SHs92DrFCO2MOYL2ifolvOE,6329
40
41
  mgpsogui/util/recosu/__init__.py,sha256=T7_iigIlowGbPOHLO3hwihjw2kbwIg6olOMhFhNiL38,236
@@ -46,8 +47,8 @@ mgpsogui/util/recosu/utils/trace_writer.py,sha256=V9BJlOjCbNYGoXGEk3CF5wjifBxvar
46
47
  mgpsogui/util/recosu/utils/utils.py,sha256=QB8vftq3142ekG0ORjz0ZBHU5YknXbR0oTsrxrPAsF0,3951
47
48
  mgpsogui/util/recosu/utils/plot/__init__.py,sha256=h1KjM7_tNDv351pcwt8A6Ibb1jhwWyx5Gbu-zj-sI3Q,71
48
49
  mgpsogui/util/recosu/utils/plot/cost_steps.py,sha256=1Ce11AJyweWkmvjXPxEygzS-h8yVLmQEDLS53yjPLqQ,3779
49
- mg_pso_gui-0.1.99.dist-info/METADATA,sha256=thNYGiwKYHwsYGsVzEWLdDtBUYEJ_scc5WHxbSKhOhc,9458
50
- mg_pso_gui-0.1.99.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
51
- mg_pso_gui-0.1.99.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
52
- mg_pso_gui-0.1.99.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
53
- mg_pso_gui-0.1.99.dist-info/RECORD,,
50
+ mg_pso_gui-0.1.101.dist-info/METADATA,sha256=3cOCTGkv-XZ8YTViUfiD85Ye6WzwS30OQgGQ8H5mny0,9459
51
+ mg_pso_gui-0.1.101.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
52
+ mg_pso_gui-0.1.101.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
53
+ mg_pso_gui-0.1.101.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
54
+ mg_pso_gui-0.1.101.dist-info/RECORD,,
@@ -6,8 +6,8 @@ import threading
6
6
  import time
7
7
  import os
8
8
 
9
- from cosu.pso import global_best
10
- #from .recosu.pso import global_best
9
+ #from cosu.pso import global_best
10
+ from .recosu.pso import global_best
11
11
 
12
12
  def enqueue_output(out, queue):
13
13
  for line in iter(out.readline, b''):
@@ -59,6 +59,16 @@ def run_process(stdout_queue, stderr_queue, results_queue, cosu_queue, data, fol
59
59
  if "strategy_" in key:
60
60
  oh_strategy[key.replace("strategy_", "")] = calibration_map[key]
61
61
 
62
+ config = {
63
+ 'service_timeout': int(calibration_map['service_timeout']),
64
+ 'http_retry': int(calibration_map['http_retry']),
65
+ 'http_allow_redirects': True if calibration_map['allow_redirects'] == "True" else False,
66
+ 'async_call': True if calibration_map['async_call'] == "True" else False,
67
+ 'http_conn_timeout': int(calibration_map['conn_timeout']),
68
+ 'http_read_timeout': int(calibration_map['read_timeout']),
69
+ 'particles_fail': int(calibration_map['particles_fail'])
70
+ }
71
+
62
72
  print("\n")
63
73
  print(calibration_map)
64
74
  print("\n")
@@ -66,9 +76,15 @@ def run_process(stdout_queue, stderr_queue, results_queue, cosu_queue, data, fol
66
76
  print("\n")
67
77
  print(oh_strategy)
68
78
  print("\n")
79
+ print(config)
80
+ print("\n")
81
+
82
+
69
83
 
70
84
  print("Running global_best...\n")
71
85
 
86
+
87
+
72
88
  optimizer, trace = global_best(steps,
73
89
  rounds=(int(calibration_map['min_rounds']), int(calibration_map['max_rounds'])),
74
90
  args=args,
@@ -78,17 +94,7 @@ def run_process(stdout_queue, stderr_queue, results_queue, cosu_queue, data, fol
78
94
  # ftol=0.00000001,
79
95
  options=options,
80
96
  oh_strategy=oh_strategy,
81
- conf={
82
- 'service_timeout': int(calibration_map['service_timeout']),
83
- 'http_retry': int(calibration_map['http_retry']),
84
- 'http_allow_redirects': True if calibration_map['allow_redirects'] == "True" else False,
85
- 'async_call': True if calibration_map['async_call'] == "True" else False,
86
- 'http_conn_timeout': int(calibration_map['conn_timeout']),
87
- 'http_read_timeout': int(calibration_map['read_timeout']),
88
- 'particles_fail': int(calibration_map['particles_fail'])
89
- #, 'step_trace': os.path.join(folder, 'trace.json')
90
- },
91
- #result_queue = cosu_queue
97
+ conf=config
92
98
  )
93
99
 
94
100
  results_queue.put(trace)
mgpsogui/util/debug.py ADDED
@@ -0,0 +1,118 @@
1
+ from recosu.pso import global_best
2
+
3
+ # 1) COSU steps, definition of parameters to calibrate
4
+ steps = [
5
+ { # step 1
6
+ 'param': [
7
+ {
8
+ 'name': 'soilOutLPS',
9
+ 'bounds': (0.0, 2.0)
10
+ },
11
+ {
12
+ 'name': 'lagInterflow',
13
+ 'bounds': (10.0, 80.0)
14
+ }
15
+ ],
16
+ 'objfunc': [
17
+ {
18
+ 'name': 'ns', # Name (Must be unique)
19
+ 'of':'ns', # Objective Function
20
+ 'data': ('obs_data02_14.csv/obs/orun[1]',
21
+ 'output/csip_run/out/Outlet.csv/output/catchmentSimRunoff')
22
+ # Optional Weight parameter. If not specified it is 1 or evenly distributed between all objective functions
23
+ }
24
+ ]
25
+ },
26
+ { # step 2
27
+ 'param': [
28
+ {
29
+ 'name': 'flowRouteTA',
30
+ 'bounds': (0.4, 5.0)
31
+ },
32
+ {
33
+ 'name': 'soilMaxDPS',
34
+ 'bounds': (0.0, 5.0)
35
+ }
36
+ ],
37
+ 'objfunc': [
38
+ {
39
+ 'name': 'ns',
40
+ 'of':'ns',
41
+ 'data': ('obs_data02_14.csv/obs/orun[1]',
42
+ 'output/csip_run/out/Outlet.csv/output/catchmentSimRunoff')
43
+ }
44
+ ]
45
+ }
46
+ ]
47
+
48
+ # 2) static ages parameters
49
+ args = {
50
+ 'param': [
51
+ {
52
+ "name": "startTime",
53
+ "value": "2002-01-01"
54
+ },
55
+ {
56
+ "name": "endTime",
57
+ "value": "2006-12-31"
58
+ },
59
+ {
60
+ "name": "dataStartTime",
61
+ "value": "2002-01-01"
62
+ },
63
+ {
64
+ "name": "dataEndTime",
65
+ "value": "2006-12-31"
66
+ },
67
+ {
68
+ "name": "cal_startTime",
69
+ "value": "2003-01-01"
70
+ },
71
+ {
72
+ "name": "cal_endTime",
73
+ "value": "2006-12-31"
74
+ },
75
+ {
76
+ "name": "parallelismThreads",
77
+ "value": "2"
78
+ },
79
+ {
80
+ "name": "flagLoadState",
81
+ "value": "True"
82
+ },
83
+ {
84
+ "name": "payload",
85
+ "value": "false"
86
+ },
87
+ {
88
+ "name": "project",
89
+ "value": "SFIR3"
90
+ }
91
+ ],
92
+ # the service url
93
+ 'url': 'http://csip.engr.colostate.edu:8087/csip-oms/m/ages/0.3.0',
94
+
95
+ # the files to attach for each run
96
+ 'files': {}
97
+ }
98
+
99
+ # 3. perform optimization
100
+ optimizer, trace = global_best(steps, # step definition
101
+ rounds=(1, 2), # min/max number of rounds
102
+ args=args, # static arguments
103
+ n_particles=10, # number of particle candidates for each param
104
+ iters=20, # max # of iterations
105
+ n_threads=10, # number of threads to use
106
+ # ftol=0.00000001, # min cost function delta for convergence
107
+ options={'c1': 2, 'c2': 2, 'w': 0.8}, # hyperparameter
108
+ oh_strategy={ "w":'adaptive', "c1":'adaptive',"c2":'adaptive'}, # adaptive hyperparameter adjustments based on current and max # of iterations
109
+ conf={
110
+ 'service_timeout': 400.0,
111
+ 'http_retry': 5,
112
+ 'http_allow_redirects': True,
113
+ 'async_call': False,
114
+ 'http_conn_timeout': 10,
115
+ 'http_read_timeout': 400,
116
+ 'particles_fail': 5
117
+ }
118
+ )