From b273cb548f399df714adf7ef26926226b74ecc07 Mon Sep 17 00:00:00 2001 From: Benjamin Bertrand Date: Tue, 7 Mar 2017 09:27:40 +0300 Subject: [PATCH] simplify selection in term_bilan --- notes_tools/generate_bilan/term_bilan.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/notes_tools/generate_bilan/term_bilan.py b/notes_tools/generate_bilan/term_bilan.py index 95a3edd..875e951 100755 --- a/notes_tools/generate_bilan/term_bilan.py +++ b/notes_tools/generate_bilan/term_bilan.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # encoding: utf-8 -from notes_tools.tools import extract_flat_marks, get_class_ws, digest_flat_df, term_tools, eval_tools +from notes_tools.tools import extract_flat_marks, get_class_ws, digest_flat_df, term_tools from .texenv import feed_template import pandas as pd import numpy as np @@ -49,13 +49,12 @@ def term_bilan(classe, term, path = Path('./'), logger.info("Worksheets of {} imported".format(classe)) flat_df = extract_flat_marks(ws) - quest_df, exo_df, eval_df = digest_flat_df(flat_df) logger.info("Worksheets parsed") - quest_df, exo_df, eval_df = \ - term_tools.select(quest_df, exo_df, eval_df, term) - _, conn_df, _ = \ - eval_tools.select_contains(quest_df, exo_df, eval_df, "Conn") + term_df = flat_df[flat_df['Trimestre'] == term] + + quest_df, exo_df, eval_df = digest_flat_df(term_df) + conn_df = exo_df[exo_df["Nom"].str.contains('Conn')] bilan_info = term_info(classe, eval_df) students = term_tools.students_pov(quest_df, exo_df, eval_df)