-
Notifications
You must be signed in to change notification settings - Fork 4
/
gui.py
65 lines (54 loc) · 1.52 KB
/
gui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import os
import sys
module_path = os.path.abspath(os.path.join('.'))
if module_path not in sys.path:
sys.path.append(module_path)
from gooey import Gooey, GooeyParser
from modeler.wrapper import Modeler
@Gooey()
def main():
parser = GooeyParser(description='Process some integers.')
modeler = Modeler()
parser.add_argument(
'country',
widget='Dropdown',
choices=modeler.c.show_countries(),
help='Select a country from the list'
)
# predict_len=15, use_default_models=True, mode='notebook', output_folder='output', plot_mode='image'
parser.add_argument(
'--predict_len',
default=15,
metavar='Prediction length',
type=int,
help='Days to predict from the last train date'
)
parser.add_argument(
'--output_folder',
default='output',
metavar='Output folder',
type=str,
help='Where to put write the results'
)
parser.add_argument(
'--show_plot',
metavar='Show plot after finished',
widget='Dropdown',
choices=['Yes', 'No'],
default='Yes',
help='Show the plot after finishing'
)
args = parser.parse_args()
print(args)
show_plot = str(args.show_plot) == 'Yes'
modeler = Modeler(
country=args.country,
predict_len=args.predict_len,
output_folder=args.output_folder,
mode='cli',
plot_mode='html',
show_plot=show_plot
)
modeler.process()
if __name__ == '__main__':
main()