From 1e7cc0639992e0f40d8586d163aad11ff1e38f41 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 25 Aug 2022 18:43:24 +0200 Subject: [PATCH] Fix #394 (export Apo NaN) --- app/scodoc/sco_apogee_csv.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/scodoc/sco_apogee_csv.py b/app/scodoc/sco_apogee_csv.py index e6b40842b..d36d8e9c3 100644 --- a/app/scodoc/sco_apogee_csv.py +++ b/app/scodoc/sco_apogee_csv.py @@ -92,6 +92,7 @@ import time from zipfile import ZipFile from flask import send_file +import numpy as np # Pour la détection auto de l'encodage des fichiers Apogée: from chardet import detect as chardet_detect @@ -134,6 +135,8 @@ def _apo_fmt_note(note, fmt="%3.2f"): val = float(note) except ValueError: return "" + if np.isnan(val): + return "" return (fmt % val).replace(".", APO_DECIMAL_SEP)