Commit 7f16fbd5 authored by Odair M.'s avatar Odair M.
Browse files

arruma diretório no qual os jsons são salvos

parent a153b366
...@@ -12,14 +12,12 @@ except NameError: ...@@ -12,14 +12,12 @@ except NameError:
to_unicode = str to_unicode = str
def build_cache(dataframe): def build_cache(dataframe,path):
# os.chdir("../src") # os.chdir("../src")
path = 'cache/curso'
ensure_path_exists(path) ensure_path_exists(path)
for cod, df in dataframe.groupby('COD_CURSO'): for cod, df in dataframe.groupby('COD_CURSO'):
path = path + '/' + cod + '/' path = path + '/'
generate_degree_data(path, df) generate_degree_data(path, df)
generate_student_data(path+'students/',df) generate_student_data(path+'students/',df)
#~ generate_admission_data(path+'/'+cod+'/admission/',df) #~ generate_admission_data(path+'/'+cod+'/admission/',df)
......
...@@ -10,10 +10,10 @@ from datetime import timedelta ...@@ -10,10 +10,10 @@ from datetime import timedelta
def analyze(submission): def analyze(submission):
start_time = time.clock() start_time = time.clock()
start_time_exec = time.time() start_time_exec = time.time()
path = submission.path()
dataframe = load_dataframes(path)
dataframe = load_dataframes(submission.path()) build_cache(dataframe,path)
build_cache(dataframe)
submission.set_done(round(time.clock() - start_time)) submission.set_done(round(time.clock() - start_time))
......
...@@ -22,7 +22,7 @@ def build_path(path): ...@@ -22,7 +22,7 @@ def build_path(path):
def ensure_path_exists(complete_path): def ensure_path_exists(complete_path):
parts = complete_path.split('/') parts = complete_path.split('/')
for i in range(len(parts)): for i in range(1,len(parts)):
if not os.path.exists('/'.join(parts[:i+1])): if not os.path.exists('/'.join(parts[:i+1])):
os.mkdir('/'.join(parts[:i+1])) os.mkdir('/'.join(parts[:i+1]))
......
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