mg-pso-gui 0.1.114__py3-none-any.whl → 0.1.116__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.
- {mg_pso_gui-0.1.114.dist-info → mg_pso_gui-0.1.116.dist-info}/METADATA +2 -2
- {mg_pso_gui-0.1.114.dist-info → mg_pso_gui-0.1.116.dist-info}/RECORD +8 -7
- mgpsogui/gui/HomePage.py +2 -21
- mgpsogui/util/PSORunner.py +1 -1
- mgpsogui/util/sampler_test_driver.py +129 -0
- {mg_pso_gui-0.1.114.dist-info → mg_pso_gui-0.1.116.dist-info}/WHEEL +0 -0
- {mg_pso_gui-0.1.114.dist-info → mg_pso_gui-0.1.116.dist-info}/entry_points.txt +0 -0
- {mg_pso_gui-0.1.114.dist-info → mg_pso_gui-0.1.116.dist-info}/top_level.txt +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: mg-pso-gui
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.116
|
|
4
4
|
Summary: GUI for MG-PSO
|
|
5
5
|
Author: Robert Cordingly
|
|
6
6
|
Author-email: <rcording@uw.ed>
|
|
7
7
|
Keywords: python,muti-group,pso,particle,swarm,optimization,gui
|
|
8
8
|
Classifier: Development Status :: 1 - Planning
|
|
9
9
|
Classifier: Intended Audience :: Developers
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
11
11
|
Classifier: Operating System :: Unix
|
|
12
12
|
Classifier: Operating System :: MacOS :: MacOS X
|
|
13
13
|
Classifier: Operating System :: Microsoft :: Windows
|
|
@@ -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=
|
|
4
|
+
mgpsogui/gui/HomePage.py,sha256=ksg0aijFz4LyYngyr-h2Bx5B0S8b__5bVH0Ty6wd5n0,24197
|
|
5
5
|
mgpsogui/gui/OptionManager.py,sha256=H5ofd7PA5f6dVfSghUhKdPiqLHNE0IVpPPzf93k7JD4,12527
|
|
6
6
|
mgpsogui/gui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
mgpsogui/gui/PlatformTab/PlatformTab.py,sha256=KyIoHlMKD9nfQqHeGJwRDA4RCoe4UykjB2l6xMTKK_M,10486
|
|
@@ -33,10 +33,11 @@ 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=
|
|
36
|
+
mgpsogui/util/PSORunner.py,sha256=9SqWAzSqpti6nPDTvheTleV19AzjQukfrxJifyyhQ9Q,3930
|
|
37
37
|
mgpsogui/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
38
38
|
mgpsogui/util/debug.py,sha256=36oZ3wf3_zGQbdZLGwHJ1Kk8QArl9pjNqkIaz6IPt74,19742
|
|
39
39
|
mgpsogui/util/helpers.py,sha256=fCfVDaGholx16FVVqf2BhWs9KCevI7aFIve1w2W68EQ,769
|
|
40
|
+
mgpsogui/util/sampler_test_driver.py,sha256=1iJTLVFZ_VCsuIdl3mXQBA1GNAH5jJO3z5h4E_bd5U8,3703
|
|
40
41
|
mgpsogui/util/CTkToolTip/__init__.py,sha256=G1jxV55hGtGgwyC1sR-uUUdasDdh0XZgcI-aILgGYA0,225
|
|
41
42
|
mgpsogui/util/CTkToolTip/ctk_tooltip.py,sha256=SZMovpQIGvdpDRbqCKl9SHs92DrFCO2MOYL2ifolvOE,6329
|
|
42
43
|
mgpsogui/util/recosu/__init__.py,sha256=T7_iigIlowGbPOHLO3hwihjw2kbwIg6olOMhFhNiL38,236
|
|
@@ -48,8 +49,8 @@ mgpsogui/util/recosu/utils/trace_writer.py,sha256=V9BJlOjCbNYGoXGEk3CF5wjifBxvar
|
|
|
48
49
|
mgpsogui/util/recosu/utils/utils.py,sha256=QB8vftq3142ekG0ORjz0ZBHU5YknXbR0oTsrxrPAsF0,3951
|
|
49
50
|
mgpsogui/util/recosu/utils/plot/__init__.py,sha256=h1KjM7_tNDv351pcwt8A6Ibb1jhwWyx5Gbu-zj-sI3Q,71
|
|
50
51
|
mgpsogui/util/recosu/utils/plot/cost_steps.py,sha256=1Ce11AJyweWkmvjXPxEygzS-h8yVLmQEDLS53yjPLqQ,3779
|
|
51
|
-
mg_pso_gui-0.1.
|
|
52
|
-
mg_pso_gui-0.1.
|
|
53
|
-
mg_pso_gui-0.1.
|
|
54
|
-
mg_pso_gui-0.1.
|
|
55
|
-
mg_pso_gui-0.1.
|
|
52
|
+
mg_pso_gui-0.1.116.dist-info/METADATA,sha256=4eYdgtaJA99asCmn5hSu6MBeG0cWfoDpwmDo828j6sA,9460
|
|
53
|
+
mg_pso_gui-0.1.116.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
54
|
+
mg_pso_gui-0.1.116.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
|
|
55
|
+
mg_pso_gui-0.1.116.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
|
|
56
|
+
mg_pso_gui-0.1.116.dist-info/RECORD,,
|
mgpsogui/gui/HomePage.py
CHANGED
|
@@ -55,7 +55,6 @@ customtkinter.set_default_color_theme("blue") # Themes: "blue" (standard), "gre
|
|
|
55
55
|
results_queue = Queue()
|
|
56
56
|
stdout_queue = Queue()
|
|
57
57
|
stderr_queue = Queue()
|
|
58
|
-
cosu_queue = Queue()
|
|
59
58
|
|
|
60
59
|
class App(customtkinter.CTk):
|
|
61
60
|
def __init__(self):
|
|
@@ -432,7 +431,7 @@ class App(customtkinter.CTk):
|
|
|
432
431
|
if (os.path.exists(os.path.join(folder, 'error.txt'))):
|
|
433
432
|
os.remove(os.path.join(folder, 'error.txt'))
|
|
434
433
|
|
|
435
|
-
self.train_process = Process(target=PSORunner.run_process, args=(stdout_queue, stderr_queue, results_queue,
|
|
434
|
+
self.train_process = Process(target=PSORunner.run_process, args=(stdout_queue, stderr_queue, results_queue, metrics, folder))
|
|
436
435
|
self.train_process.daemon = True
|
|
437
436
|
self.train_process.start()
|
|
438
437
|
self.after(1000, self.watch_loop)
|
|
@@ -508,28 +507,18 @@ class App(customtkinter.CTk):
|
|
|
508
507
|
print("# " + stdout_line, flush=True)
|
|
509
508
|
with open(os.path.join(folder, 'output.txt'), 'a') as f:
|
|
510
509
|
f.write(stdout_line)
|
|
511
|
-
|
|
512
510
|
except Empty:
|
|
513
511
|
break
|
|
514
512
|
|
|
515
513
|
while True:
|
|
516
514
|
try:
|
|
517
515
|
stderr_line = stderr_queue.get_nowait()
|
|
518
|
-
|
|
519
516
|
print("? " + stderr_line, flush=True)
|
|
520
517
|
with open(os.path.join(folder, 'error.txt'), 'a') as f:
|
|
521
518
|
f.write(stderr_line)
|
|
522
519
|
|
|
523
520
|
except Empty:
|
|
524
521
|
break
|
|
525
|
-
|
|
526
|
-
while True:
|
|
527
|
-
try:
|
|
528
|
-
cosu_line = cosu_queue.get_nowait()
|
|
529
|
-
|
|
530
|
-
print("COSU " + cosu_line, flush=True)
|
|
531
|
-
except Empty:
|
|
532
|
-
break
|
|
533
522
|
|
|
534
523
|
while True:
|
|
535
524
|
try:
|
|
@@ -552,14 +541,13 @@ class App(customtkinter.CTk):
|
|
|
552
541
|
target_param['optimal_value'].set(value)
|
|
553
542
|
index += 1
|
|
554
543
|
print("Applied optimal values")
|
|
555
|
-
|
|
556
|
-
|
|
557
544
|
except Empty:
|
|
558
545
|
break
|
|
559
546
|
except Exception as e:
|
|
560
547
|
print("Some error happened when getting the trace!")
|
|
561
548
|
print(e)
|
|
562
549
|
|
|
550
|
+
# Write output to textbox
|
|
563
551
|
if (os.path.exists(os.path.join(folder, 'output.txt'))):
|
|
564
552
|
with open(os.path.join(folder, 'output.txt'), 'r') as f:
|
|
565
553
|
lines = f.readlines()
|
|
@@ -593,17 +581,10 @@ class App(customtkinter.CTk):
|
|
|
593
581
|
calibrated_params = [ast.literal_eval(i) for i in calibrated_params]
|
|
594
582
|
best_particle_values = [ast.literal_eval(i) for i in best_particle_values]
|
|
595
583
|
progress_values = [tuple(map(float, i)) for i in progress_values]
|
|
596
|
-
|
|
597
|
-
#print("Current params: " + str(calibrated_params), flush=True)
|
|
598
|
-
|
|
599
584
|
self.calibration_data = calibrated_params
|
|
600
585
|
|
|
601
|
-
#GraphGenerator.calibrated_params_by_round(self.running_config['steps'], calibrated_params, self.option_manager)
|
|
602
|
-
#self.update_graph("")
|
|
603
586
|
except Exception as e:
|
|
604
|
-
# Print stack trace
|
|
605
587
|
traceback.print_exc()
|
|
606
|
-
|
|
607
588
|
print(e)
|
|
608
589
|
|
|
609
590
|
if (os.path.exists(os.path.join(folder, 'error.txt'))):
|
mgpsogui/util/PSORunner.py
CHANGED
|
@@ -14,7 +14,7 @@ def enqueue_output(out, queue):
|
|
|
14
14
|
queue.put(line)
|
|
15
15
|
out.close()
|
|
16
16
|
|
|
17
|
-
def run_process(stdout_queue, stderr_queue, results_queue,
|
|
17
|
+
def run_process(stdout_queue, stderr_queue, results_queue, data, folder):
|
|
18
18
|
steps = data['steps']
|
|
19
19
|
args = data['arguments']
|
|
20
20
|
calib = data['calibration_parameters']
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
from typing import List, Dict, Iterable
|
|
2
|
+
from recosu.sampling.sampler import run_sampler
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def main():
|
|
6
|
+
steps: List[Dict[str, any]] = [
|
|
7
|
+
{
|
|
8
|
+
"param": [
|
|
9
|
+
{
|
|
10
|
+
"name": "Ksink",
|
|
11
|
+
"bounds": [
|
|
12
|
+
0.0,
|
|
13
|
+
5.0
|
|
14
|
+
],
|
|
15
|
+
"default_value": 1.0,
|
|
16
|
+
"type": "float",
|
|
17
|
+
"calibration_strategy": "none"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "a_rain",
|
|
21
|
+
"bounds": [
|
|
22
|
+
5.0,
|
|
23
|
+
10.0
|
|
24
|
+
],
|
|
25
|
+
"default_value": 1.0,
|
|
26
|
+
"type": "float",
|
|
27
|
+
"calibration_strategy": "none"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "flowRouteTA",
|
|
31
|
+
"bounds": [
|
|
32
|
+
0.01,
|
|
33
|
+
0.1
|
|
34
|
+
],
|
|
35
|
+
"default_value": 1.0,
|
|
36
|
+
"type": "float",
|
|
37
|
+
"calibration_strategy": "none"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "soilMaxDPS",
|
|
41
|
+
"bounds": [
|
|
42
|
+
0.001,
|
|
43
|
+
10.0
|
|
44
|
+
],
|
|
45
|
+
"default_value": 1.0,
|
|
46
|
+
"type": "float",
|
|
47
|
+
"calibration_strategy": "none"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"objfunc": [
|
|
51
|
+
{
|
|
52
|
+
"name": "ns",
|
|
53
|
+
"of": "ns",
|
|
54
|
+
"weight": 1.0,
|
|
55
|
+
"data": [
|
|
56
|
+
"orun5minall.csv/Runoff/orun[0]",
|
|
57
|
+
"output/csip_run/out/subDailyOutlet.csv/output/subDailyCatchmentSimRunoff"
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
args: Dict[str, any] = {
|
|
65
|
+
"param": [
|
|
66
|
+
{
|
|
67
|
+
"name": "startTime",
|
|
68
|
+
"value": "2011-06-08"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "endTime",
|
|
72
|
+
"value": "2011-07-13"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "dataStartTime",
|
|
76
|
+
"value": "2011-06-08"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "dataEndTime",
|
|
80
|
+
"value": "2011-07-13"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "cal_startTime",
|
|
84
|
+
"value": "2011-06-08"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "cal_endTime",
|
|
88
|
+
"value": "2011-07-13"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"name": "parallelismThreads",
|
|
92
|
+
"value": "8"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "flagLoadState",
|
|
96
|
+
"value": "True"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "payload",
|
|
100
|
+
"value": "false"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"name": "project",
|
|
104
|
+
"value": "drake58hru-5min"
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
"url": "http://csip.engr.colostate.edu:8087/csip-oms/m/ages/1.0.1_sub",
|
|
108
|
+
"files": []
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
conf: Dict[str, any] = {
|
|
112
|
+
"service_timeout": 400,
|
|
113
|
+
"http_retry": 5,
|
|
114
|
+
"allow_redirects": True,
|
|
115
|
+
"async_call": True,
|
|
116
|
+
"conn_timeout": 10,
|
|
117
|
+
"read_timeout": 400,
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
trace = run_sampler(steps, args, 10, 2, "halton", conf=conf, trace_file="halton_trace.csv", offset=5)
|
|
121
|
+
print(trace)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
trace = run_sampler(steps, args, 10, 2, "random", conf=conf, trace_file="random_trace.csv")
|
|
125
|
+
print(trace)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
if __name__ == "__main__":
|
|
129
|
+
main()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|