From 54bf4a4f0f4b4d212776f8b4296721a1ef440fd9 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Wed, 3 Aug 2022 20:43:07 +0200 Subject: [PATCH] Fix #451 --- app/comp/res_common.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/comp/res_common.py b/app/comp/res_common.py index 3315f0032..52d5cd902 100644 --- a/app/comp/res_common.py +++ b/app/comp/res_common.py @@ -808,9 +808,15 @@ class ResultatsSemestre(ResultatsCache): coef = modimpl.module.coefficient or 0 row_coef[colid] = fmt_note(coef) notes = self.modimpl_notes(modimpl.id, ue.id) - row_min[colid] = fmt_note(np.nanmin(notes)) - row_max[colid] = fmt_note(np.nanmax(notes)) - moy = np.nanmean(notes) + if np.isnan(notes).all(): + # aucune note valide + row_min[colid] = np.nan + row_max[colid] = np.nan + moy = np.nan + else: + row_min[colid] = fmt_note(np.nanmin(notes)) + row_max[colid] = fmt_note(np.nanmax(notes)) + moy = np.nanmean(notes) row_moy[colid] = fmt_note(moy) if np.isnan(moy): # aucune note dans ce module