From 66c41771f42d99012b18076635f6997bc3360dbf Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Fri, 24 Feb 2023 18:32:34 +0100 Subject: [PATCH] Rangs UEs et partitions: ne tient pas compte des DEM/DEFs --- app/comp/res_compat.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/comp/res_compat.py b/app/comp/res_compat.py index 9749707ab..00b6446e6 100644 --- a/app/comp/res_compat.py +++ b/app/comp/res_compat.py @@ -175,15 +175,16 @@ class NotesTableCompat(ResultatsSemestre): dtype=float, index=self.etud_moy_gen.index, ) + etud_moy_gen_dem_zero = self.etud_moy_gen * mask_inscr ( self.etud_moy_gen_ranks, self.etud_moy_gen_ranks_int, - ) = moy_sem.comp_ranks_series(self.etud_moy_gen * mask_inscr) + ) = moy_sem.comp_ranks_series(etud_moy_gen_dem_zero) ues = self.formsemestre.query_ues() for ue in ues: moy_ue = self.etud_moy_ue[ue.id] self.ue_rangs[ue.id] = ( - moy_sem.comp_ranks_series(moy_ue)[0], # juste en chaine + moy_sem.comp_ranks_series(moy_ue * mask_inscr)[0], # juste en chaine int(moy_ue.count()), ) # .count() -> nb of non NaN values @@ -203,7 +204,7 @@ class NotesTableCompat(ResultatsSemestre): ) # list() car pandas veut une sequence pour take() # Rangs / moyenne générale: - group_moys_gen = self.etud_moy_gen[group_members] + group_moys_gen = etud_moy_gen_dem_zero[group_members] self.moy_gen_rangs_by_group[group.id] = moy_sem.comp_ranks_series( group_moys_gen ) @@ -212,7 +213,7 @@ class NotesTableCompat(ResultatsSemestre): group_moys_ue = self.etud_moy_ue[ue.id][group_members] self.ue_rangs_by_group.setdefault(ue.id, {})[ group.id - ] = moy_sem.comp_ranks_series(group_moys_ue) + ] = moy_sem.comp_ranks_series(group_moys_ue * mask_inscr) def get_etud_rang(self, etudid: int) -> str: """Le rang (classement) de l'étudiant dans le semestre.