-
Notifications
You must be signed in to change notification settings - Fork 0
/
analyze.py
42 lines (28 loc) · 1014 Bytes
/
analyze.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
import sys
import argparse
import configparser
from utils import initialize_logger
from data_analysis.initialize import initialize_all
from data_analysis.utils import \
files_analyze, general_analyze, write_back_results
information = ' '.join(sys.argv)
def main(*args, **kwargs):
parser = argparse.ArgumentParser()
parser.add_argument(
'-c', '--config'
, help='The path of config file'
, required=True
)
args = parser.parse_args()
config = configparser.ConfigParser()
config.read(args.config)
logger = initialize_logger(log_name=config.get('log', 'name'))
logger.info(f'\n\n\n\n{information}')
parameters = initialize_all(config=config)
logger.info('Start to analyze data.')
results = files_analyze(parameters=parameters)
general_analyze(parameters=parameters, results=results)
write_back_results(parameters=parameters, results=results)
logger.info('Analyze data successfully.')
if __name__ == '__main__':
main()