From ba11bd063e7effcdb7778ef2ad72e6462876508c Mon Sep 17 00:00:00 2001 From: Benjamin Bertrand Date: Sat, 1 Apr 2017 13:48:33 +0300 Subject: [PATCH] Fix bug with term.py new name --- notes_tools/reports/term_reports.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/notes_tools/reports/term_reports.py b/notes_tools/reports/term_reports.py index 56a0904..88a8671 100755 --- a/notes_tools/reports/term_reports.py +++ b/notes_tools/reports/term_reports.py @@ -25,7 +25,7 @@ def term_info(classe, ds_df): eval_info["Trimestre"] = ds_df["Trimestre"].unique()[0] 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_target_name("312", "DS1") @@ -33,9 +33,9 @@ def build_target_name(classe, term, path = Path("./")): >>> build_target_name("312", "DS1", Path("plop/")) 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"): """ 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) 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) #conn_df = exo_df[exo_df["Nom"].str.contains('Conn')] @@ -66,7 +66,7 @@ def term_report(classe, term, path = Path('./'), "students":students_pov, } - target = build_target_name(classe, term, path) + target = build_target_name(classe, term_num, path) feed_template(target, datas, template)