From 5c2c97cfb31865fafb9444b273db12a37ad2c00c Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sat, 11 Dec 2021 12:10:05 +0100 Subject: [PATCH] =?UTF-8?q?Calcul=20moyenne=20g=C3=A9n=C3=A9rale=20indicat?= =?UTF-8?q?ive?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/but/bulletin_but.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/but/bulletin_but.py b/app/but/bulletin_but.py index 7ee018d2f..7e41bd320 100644 --- a/app/but/bulletin_but.py +++ b/app/but/bulletin_but.py @@ -11,7 +11,7 @@ import pandas as pd from app import db -from app.comp import df_cache, moy_ue, moy_mod, inscr_mod +from app.comp import df_cache, moy_ue, moy_sem, inscr_mod from app.scodoc import sco_utils as scu from app.scodoc.sco_cache import ResultatsSemestreBUTCache from app.scodoc.sco_exceptions import ScoFormatError @@ -90,6 +90,9 @@ class ResultatsSemestreBUT: self.modimpl_inscr_df, self.modimpl_coefs_df, ) + self.etud_moy_gen = moy_sem.compute_sem_moys( + self.etud_moy_ue, self.modimpl_coefs_df + ) def etud_ue_mod_results(self, etud, ue, modimpls) -> dict: "dict synthèse résultats dans l'UE pour les modules indiqués" @@ -212,10 +215,10 @@ class ResultatsSemestreBUT: "ues": {ue.acronyme: self.etud_ue_results(etud, ue) for ue in self.ues}, "semestre": { "notes": { # moyenne des moyennes générales du semestre - "value": fmt_note("xxx"), # XXX TODO - "min": fmt_note("0."), - "moy": fmt_note("10.0"), - "max": fmt_note("20.00"), + "value": fmt_note(self.etud_moy_gen[etud.id]), + "min": fmt_note(self.etud_moy_gen.min()), + "moy": fmt_note(self.etud_moy_gen.mean()), + "max": fmt_note(self.etud_moy_gen.max()), }, "rang": { # classement wrt moyenne général, indicatif "value": None, # XXX TODO