main.py 1.17 KB
Newer Older
1
2
3
4
import os
import time
from script.base.dataframe_base import load_dataframes
from script.build_cache import build_cache
bhm15's avatar
bhm15 committed
5
from script.analysis.course_analysis import *
6

bhm15's avatar
bhm15 committed
7
from datetime import timedelta
8
9


10
11
12
13
14
15
16
17
def analyze(submission):
    start_time = time.clock()
    start_time_exec = time.time()

    dataframe = load_dataframes(submission.path())

    build_cache(dataframe)

18
19
20
    submission.process_time = round(time.clock() - start_time)
    submission.save()

21
22
23
24
25
    cpu_time = timedelta(seconds=round(time.clock() - start_time))
    run_time = timedelta(seconds=round(time.time() - start_time_exec))
    print("--- Tempo de CPU: {} ---".format(cpu_time))
    print("--- Tempo total: {} ---".format(run_time))

26

27
def main():
28
29
30
31
32
33
    start_time = time.clock()
    start_time_exec = time.time()

    dataframe = load_dataframes(os.getcwd() + '/script/' + 'base')
    build_cache(dataframe)
    cpu_time = timedelta(seconds=round(time.clock() - start_time))
bhm15's avatar
bhm15 committed
34
    analises_disciplinas(dataframe)
35
36
37
    run_time = timedelta(seconds=round(time.time() - start_time_exec))
    print("--- Tempo de CPU: {} ---".format(cpu_time))
    print("--- Tempo total: {} ---".format(run_time))
38
39

if __name__ == "__main__":
40
    main()