Commit 476cb087 authored by Odair M.'s avatar Odair M.
Browse files

Merge branch 'course' into 'master'

Course

See merge request !16
parents 1a80b590 7504f0e0
Pipeline #15277 failed with stage
in 2 minutes and 14 seconds
......@@ -285,7 +285,7 @@ def listagem_disciplina(df,lista_disciplinas):
reprovacao_media = np.mean(trancamento_np)
reprovacao_desvio = np.std(trancamento_np)
#verifica se o resultado final não é nan
#verificar se o resultado final não é nan
listagem = { "cache" : cache,
"compara_aprov": compara_aprov,
......@@ -296,15 +296,5 @@ def listagem_disciplina(df,lista_disciplinas):
"taxa_reprovacao":[float(reprovacao_media),float(reprovacao_desvio)] ,
"nota": [float(nota_media),float(nota_desvio)]
}
with open("cache/disciplinas.json",'w') as f:
f.write(json.dumps(listagem,indent=4))
# [ ] ->media_disc
# [ ] compara_aprov
def analises_disciplinas(df):
lista_disciplinas = {}
informacoes_gerais(df,lista_disciplinas)
analises_gerais(df,lista_disciplinas)
analises_semestrais(df,lista_disciplinas)
transforma_json(lista_disciplinas)
listagem_disciplina(df,lista_disciplinas)
return listagem
......@@ -2,6 +2,7 @@ from script.utils.utils import *
from script.utils.situations import *
from script.analysis.degree_analysis import *
from script.analysis.student_analysis import *
from script.analysis.course_analysis import *
from script.analysis.admission_analysis import *
......@@ -18,16 +19,16 @@ def build_cache(dataframe):
ensure_path_exists(path)
for cod, df in dataframe.groupby('COD_CURSO'):
generate_degree_data(path+'/'+cod+'/', df)
generate_student_data(path+'/'+cod+'/students/',df)
path = path + '/' + cod + '/'
generate_degree_data(path, df)
generate_student_data(path+'students/',df)
#~ generate_admission_data(path+'/'+cod+'/admission/',df)
#generate_degree_data(path, dataframe)
#generate_student_data(path, dataframe)
#generate_student_list(path)
#generate_admission_data(path)
#generate_admission_list(path)
#generate_course_data(path)
#generate_course_general_data(path)
generate_course_data(path+'disciplina/' ,dataframe)
def generate_degree_data(path, dataframe):
ensure_path_exists(path)
......@@ -145,8 +146,13 @@ def generate_admission_data(path,df):
def generate_admission_list(path):
pass
def generate_course_data(path):
pass
def generate_course_general_data(path):
pass
def generate_course_data(path,df):
lista_disciplinas = {}
informacoes_gerais(df,lista_disciplinas)
analises_gerais(df,lista_disciplinas)
analises_semestrais(df,lista_disciplinas)
for disciplina in lista_disciplinas.keys():
save_json(path+disciplina+'.json' ,lista_disciplinas[disciplina])
disciplinas = listagem_disciplina(df,lista_disciplinas)
save_json(path+'disciplinas.json',disciplinas)
......@@ -27,11 +27,10 @@ def main():
start_time = time.clock()
start_time_exec = time.time()
dataframe = load_dataframes(os.getcwd() + '/script/' + 'base')
dataframe = load_dataframes(os.getcwd() + '/script/' + 'base/21A/1/')
build_cache(dataframe)
cpu_time = timedelta(seconds=round(time.clock() - start_time))
analises_disciplinas(dataframe)
run_time = timedelta(seconds=round(time.time() - start_time_exec))
print("--- Tempo de CPU: {} ---".format(cpu_time))
print("--- Tempo total: {} ---".format(run_time))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment