1
0
forked from ScoDoc/ScoDoc

Rangs UEs et partitions: ne tient pas compte des DEM/DEFs

This commit is contained in:
Emmanuel Viennet 2023-02-24 18:32:34 +01:00
parent 0ac50d6e15
commit 66c41771f4

View File

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