From 8473270ee632db0fae37a854ca0b3b3782a910de Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Wed, 26 Jan 2022 22:59:53 +0100 Subject: [PATCH] clip bonus --- app/comp/res_but.py | 9 ++++++--- app/comp/res_classic.py | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/comp/res_but.py b/app/comp/res_but.py index e1fcdc27..e7c6d4c4 100644 --- a/app/comp/res_but.py +++ b/app/comp/res_but.py @@ -61,9 +61,7 @@ class ResultatsSemestreBUT(NotesTableCompat): self.etud_coef_ue_df = pd.DataFrame( 1.0, index=self.etud_moy_ue.index, columns=self.etud_moy_ue.columns ) - self.etud_moy_gen = moy_sem.compute_sem_moys_apc( - self.etud_moy_ue, modimpl_coefs_no_bonus_df - ) + # --- Bonus Sport & Culture bonus_class = ScoDocSiteConfig.get_bonus_sport_class() if bonus_class is not None: @@ -79,7 +77,12 @@ class ResultatsSemestreBUT(NotesTableCompat): self.bonus_ues = bonus.get_bonus_ues() if self.bonus_ues is not None: self.etud_moy_ue += self.bonus_ues # somme les dataframes + self.etud_moy_ue.clip(lower=0.0, upper=20.0, inplace=True) + # Moyenne générale indicative: + self.etud_moy_gen = moy_sem.compute_sem_moys_apc( + self.etud_moy_ue, modimpl_coefs_no_bonus_df + ) self.etud_moy_gen_ranks = moy_sem.comp_ranks_series(self.etud_moy_gen) def get_etud_mod_moy(self, moduleimpl_id: int, etudid: int) -> float: diff --git a/app/comp/res_classic.py b/app/comp/res_classic.py index 65c83e64..8d52d0c3 100644 --- a/app/comp/res_classic.py +++ b/app/comp/res_classic.py @@ -86,9 +86,11 @@ class ResultatsSemestreClassic(NotesTableCompat): self.bonus_ues = bonus.get_bonus_ues() if self.bonus_ues is not None: self.etud_moy_ue += self.bonus_ues # somme les dataframes + self.etud_moy_ue.clip(lower=0.0, upper=20.0, inplace=True) bonus_mg = bonus.get_bonus_moy_gen() if bonus_mg is not None: self.etud_moy_gen += bonus_mg + self.etud_moy_gen.clip(lower=0.0, upper=20.0, inplace=True) self.bonus = ( bonus_mg # compat nt, utilisé pour l'afficher sur les bulletins )