Fix bug with term.py new name

This commit is contained in:
Benjamin Bertrand 2017-04-01 13:48:33 +03:00
parent 738cf00655
commit ba11bd063e

View File

@ -25,7 +25,7 @@ def term_info(classe, ds_df):
eval_info["Trimestre"] = ds_df["Trimestre"].unique()[0] eval_info["Trimestre"] = ds_df["Trimestre"].unique()[0]
return eval_info return eval_info
def build_target_name(classe, term, path = Path("./")): def build_target_name(classe, term_num, path = Path("./")):
""" Build the path where the .tex will be sored """ Build the path where the .tex will be sored
>>> build_target_name("312", "DS1") >>> build_target_name("312", "DS1")
@ -33,9 +33,9 @@ def build_target_name(classe, term, path = Path("./")):
>>> build_target_name("312", "DS1", Path("plop/")) >>> build_target_name("312", "DS1", Path("plop/"))
Path('plop/312/report_DS1.tex') Path('plop/312/report_DS1.tex')
""" """
return Path(path + "/{cls}/report_T{term}.tex".format(cls=classe, term=term)) return Path(path + "/{cls}/report_T{term_num}.tex".format(cls=classe, term_num=term_num))
def term_report(classe, term, path = Path('./'), def term_report(classe, term_num, path = Path('./'),
template = "tpl_reports_term.tex"): template = "tpl_reports_term.tex"):
""" Generate the report of a evaluation for a class """ Generate the report of a evaluation for a class
@ -51,7 +51,7 @@ def term_report(classe, term, path = Path('./'),
flat_df = extract_flat_marks(ws) flat_df = extract_flat_marks(ws)
logger.info("Worksheets parsed") logger.info("Worksheets parsed")
term_df = flat_df[flat_df['Trimestre'] == term] term_df = flat_df[flat_df['Trimestre'] == term_num]
quest_df, exo_df, eval_df = digest_flat_df(term_df) quest_df, exo_df, eval_df = digest_flat_df(term_df)
#conn_df = exo_df[exo_df["Nom"].str.contains('Conn')] #conn_df = exo_df[exo_df["Nom"].str.contains('Conn')]
@ -66,7 +66,7 @@ def term_report(classe, term, path = Path('./'),
"students":students_pov, "students":students_pov,
} }
target = build_target_name(classe, term, path) target = build_target_name(classe, term_num, path)
feed_template(target, datas, template) feed_template(target, datas, template)