clip bonus

This commit is contained in:
Emmanuel Viennet 2022-01-26 22:59:53 +01:00
parent d146d5f554
commit 8473270ee6
2 changed files with 8 additions and 3 deletions

View File

@ -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:

View File

@ -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
)