diff --git a/notes_tools/generate_bilan/templates/tpl_bilan_term.tex b/notes_tools/generate_bilan/templates/tpl_bilan_term.tex index d43ec6d..27e70d4 100644 --- a/notes_tools/generate_bilan/templates/tpl_bilan_term.tex +++ b/notes_tools/generate_bilan/templates/tpl_bilan_term.tex @@ -15,13 +15,21 @@ %- for e in students \maketitle -\Var{e["Nom"]} +{\Large \Var{e["Nom"]}} -\Var{e["eval"].groupby("Nom").sum()[["Mark","Bareme"]].to_latex()} +\vfill -\Var{e["quest"] | radar_on("Competence") | includegraphics(document_path=directory, scale=0.7)} -\Var{e["quest"] | radar_on("Domaine") | includegraphics(document_path=directory, scale=0.7)} +\Var{e["eval"].groupby("Nom").sum()[["Mark","Bareme"]].T.to_latex()} +\vfill +\Var{e["quest"] | radar_on("Competence") | includegraphics(document_path=directory, scale=0.6)} +\Var{e["quest"] | radar_on("Domaine") | includegraphics(document_path=directory, scale=0.6)} + +\vfill +%#\Var{conn_df} +\Var{conn_df | parallele_on("Exercice", e["Nom"]) | includegraphics(document_path=directory, scale=0.5)} + +\vfill \vfill \normalsize diff --git a/notes_tools/generate_bilan/term_bilan.py b/notes_tools/generate_bilan/term_bilan.py index f47a591..95a3edd 100755 --- a/notes_tools/generate_bilan/term_bilan.py +++ b/notes_tools/generate_bilan/term_bilan.py @@ -55,7 +55,7 @@ def term_bilan(classe, term, path = Path('./'), 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") + eval_tools.select_contains(quest_df, exo_df, eval_df, "Conn") bilan_info = term_info(classe, eval_df) students = term_tools.students_pov(quest_df, exo_df, eval_df) diff --git a/notes_tools/generate_bilan/texenv.py b/notes_tools/generate_bilan/texenv.py index 3a12299..fd70582 100644 --- a/notes_tools/generate_bilan/texenv.py +++ b/notes_tools/generate_bilan/texenv.py @@ -31,9 +31,10 @@ texenv = jinja2.Environment( from .filters import includegraphics texenv.filters['includegraphics'] = includegraphics -from notes_tools.tools.marks_plottings import radar_on, marks_hist +from notes_tools.tools.marks_plottings import radar_on, marks_hist, parallele_on texenv.filters['radar_on'] = radar_on texenv.filters['marks_hist'] = marks_hist +texenv.filters['parallele_on'] = parallele_on def feed_template(target, datas, template): """ Get the template and feed it to create bilans diff --git a/notes_tools/tools/marks_plottings.py b/notes_tools/tools/marks_plottings.py index b8d6bec..97f4cf5 100644 --- a/notes_tools/tools/marks_plottings.py +++ b/notes_tools/tools/marks_plottings.py @@ -45,6 +45,26 @@ def marks_hist(df): return ax +def parallele_on(df, index, student=None): + """ Plot parallele one line by student + + :param df: TODO + :param index: TODO + :returns: TODO + + """ + pt = pd.pivot_table(df, + index = [index], + values = ["Normalized"], + columns = ["Eleve"], + aggfunc = np.mean, + )["Normalized"] + ax = pt.plot(color="b", figsize=(10,5), legend=False) + pt.T.describe().T[["min", "25%","50%", "75%", "max"]].plot(ax=ax, + kind='area', stacked=False, alpha=0.2) + if not student is None: + pt.ix[:,student].plot(ax=ax, color="r") + return ax # -----------------------------