-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.py
52 lines (38 loc) · 1.35 KB
/
run.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
# --- Python Batteries Included---
import os
import argparse
# --- logging ---
import logging
log = logging.getLogger("tycho")
# --- Module Imports ---
import tycho
def main(etl=False, train=False, predict=False, plot=False, database=False):
"""Train, Predict, Merge, Calc Emissions."""
if etl:
log.info('====== Begining ETL ======')
tycho.etl()
if train:
log.info('====== Begining Train ======')
tycho.train()
if predict:
log.info('====== Begining Predict ======')
tycho.predict()
if plot:
log.info('====== Begining Plot ======')
tycho.plot()
if database:
log.info('====== Begining Database ======')
tycho.database()
if __name__ == "__main__":
# --- CLI arguments ---
parser = argparse.ArgumentParser(description='Full Pipeline for Tycho including ETL, Train, Predict, Plot, and host local dashboard.')
parser.add_argument('-e','--etl', action='store_true')
parser.add_argument('-t','--train', action='store_true')
parser.add_argument('-pr','--predict', action='store_true')
parser.add_argument('-pl','--plot', action='store_true')
parser.add_argument('-db', '--database', action='store_true')
# --- Parse args ---
args = parser.parse_args()
args_dict = vars(args)
# --- Run Tycho ---
main(**args_dict)