From 387af40b65012e505957ff361e08e5ba27b4ce1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9o=20BARAS=20=28IUT1=20Grenoble=29?= Date: Thu, 1 Feb 2024 18:10:21 +0100 Subject: [PATCH] =?UTF-8?q?Am=C3=A9liore=20les=20ent=C3=AAtes=20de=20l'exp?= =?UTF-8?q?ort=20Excel=20+=20s=C3=A9pare=20donn=C3=A9es=20min/moy/max?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/pe/pe_jury.py | 54 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/app/pe/pe_jury.py b/app/pe/pe_jury.py index 2ac919629..dca92de3d 100644 --- a/app/pe/pe_jury.py +++ b/app/pe/pe_jury.py @@ -323,9 +323,9 @@ class JuryPE(object): for etudid in etudids: etudiant = self.etudiants.identites[etudid] donnees[etudid] = { - "Nom": etudiant.nom, - "Prenom": etudiant.prenom, - "Civilite": etudiant.civilite_str, + ("Identité", "", "Civilite"): etudiant.civilite_str, + ("Identité", "", "Nom"): etudiant.nom, + ("Identité", "", "Prenom"): etudiant.prenom, } for aggregat in aggregats: @@ -334,9 +334,11 @@ class JuryPE(object): # Les moyennes par tag de cette trajectoire donnees[etudid] |= { - f"{aggregat} notes ": "-", - f"{aggregat} class. (groupe)": "-", - f"{aggregat} min | moy | max (groupe)": "-", + (aggregat, "", "notes"): "-", + (aggregat, "groupe", "class."): "-", + (aggregat, "groupe", "min"): "-", + (aggregat, "groupe", "moy"): "-", + (aggregat, "groupe", "max"): "-", } if trajectoire: trajectoire_tagguee = self.trajectoires_tagguees[ @@ -346,23 +348,47 @@ class JuryPE(object): bilan = trajectoire_tagguee.moyennes_tags[tag] donnees[etudid] |= { - f"{aggregat} notes ": round(bilan["notes"].loc[etudid], 2), - f"{aggregat} class. (groupe)": f"{bilan['classements'].loc[etudid]}/{bilan['nb_inscrits']}", - f"{aggregat} min | moy | max (groupe)": f"{bilan['min']:.1f} | {bilan['moy']:.1f} | {bilan['max']:.1f}", + (aggregat, "", "notes"): round( + bilan["notes"].loc[etudid], 2 + ), + ( + aggregat, + "groupe", + "class", + ): f"{bilan['classements'].loc[etudid]}/{bilan['nb_inscrits']}", + (aggregat, "groupe", "min"): round( + bilan["min"], 2 + ), + (aggregat, "groupe", "moy"): round( + bilan["moy"], 2 + ), + (aggregat, "groupe", "max"): round( + bilan["max"], 2 + ) } """L'interclassement""" interclass = self.interclassements_taggues[aggregat] donnees[etudid] |= { - f"{aggregat} class. (promo)": "-", - f"{aggregat} min | moy | max (promo)": "-", + (aggregat, f"promotion {self.diplome}", "class."): "-", + (aggregat, f"promotion {self.diplome}", "min"): "-", + (aggregat, f"promotion {self.diplome}", "moy"): "-", + (aggregat, f"promotion {self.diplome}", "max"): "-", } if tag in interclass.moyennes_tags: bilan = interclass.moyennes_tags[tag] donnees[etudid] |= { - f"{aggregat} class. (promo)": f"{bilan['classements'].loc[etudid]}/{bilan['nb_inscrits']}", - f"{aggregat} min | moy | max (promo)": f"{bilan['min']:.1f} | {bilan['moy']:.1f} | {bilan['max']:.1f}", + (aggregat, f"promotion {self.diplome}", "class."): f"{bilan['classements'].loc[etudid]}/{bilan['nb_inscrits']}", + (aggregat, f"promotion {self.diplome}", "min"): round( + bilan["min"], 2 + ), + (aggregat, f"promotion {self.diplome}", "moy"): round( + bilan["moy"], 2 + ), + (aggregat, f"promotion {self.diplome}", "max"): round( + bilan["max"], 2 + ) } # Fin de l'aggrégat @@ -370,7 +396,7 @@ class JuryPE(object): df = pd.DataFrame.from_dict(donnees, orient="index") # Tri par nom/prénom - df.sort_values(by=["Nom", "Prenom"], inplace=True) + df.sort_values(by=[("Identité", "", "Nom"), ("Identité", "", "Prenom")], inplace=True) return df