From 20470484d13aa5849c7b57a12ffdd47eb5462dee Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Mon, 6 Dec 2021 09:21:15 +0100 Subject: [PATCH] recap UE: filtre modules avec coef nul --- app/but/bulletin_but.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/app/but/bulletin_but.py b/app/but/bulletin_but.py index 6150c194f..20e8d4917 100644 --- a/app/but/bulletin_but.py +++ b/app/but/bulletin_but.py @@ -97,15 +97,17 @@ class ResultatsSemestreBUT: ue_idx = self.modimpl_coefs_df.index.get_loc(ue.id) etud_moy_module = self.sem_cube[etud_idx] # module x UE for mi in modimpls: - d[mi.module.code] = { - "id": mi.id, - "coef": self.modimpl_coefs_df[mi.id][ue.id], - "moyenne": jsnan( - etud_moy_module[self.modimpl_coefs_df.columns.get_loc(mi.id)][ - ue_idx - ] - ), - } + coef = self.modimpl_coefs_df[mi.id][ue.id] + if coef > 0: + d[mi.module.code] = { + "id": mi.id, + "coef": coef, + "moyenne": jsnan( + etud_moy_module[self.modimpl_coefs_df.columns.get_loc(mi.id)][ + ue_idx + ] + ), + } return d def etud_ue_results(self, etud, ue): @@ -211,6 +213,9 @@ class ResultatsSemestreBUT: "injustifie": 1, "total": 33, }, + "etapes": { # XXX TODO + # à spécifier: liste des étapes Apogée + }, "date_debut": formsemestre.date_debut.isoformat(), "date_fin": formsemestre.date_fin.isoformat(), "annee_universitaire": self.formsemestre.annee_scolaire_str(),