From cfba728f86089c2152e9019ad8fc066a65ecb5a5 Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 12 Feb 2024 08:39:37 +0100 Subject: [PATCH] Prevent KeyError for AD if only zero/one feature bands exist (#376) * Uninstall onnx to see if this is neceaasy * Fix test * Prevent KeyError if only one/zero band exist * Clean --- fink_science/anomaly_detection/processor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fink_science/anomaly_detection/processor.py b/fink_science/anomaly_detection/processor.py index 497e07bd..25805f1b 100644 --- a/fink_science/anomaly_detection/processor.py +++ b/fink_science/anomaly_detection/processor.py @@ -120,7 +120,7 @@ def get_key(x, band): ) ) ): - return pd.Series({}, dtype=np.float64) + return pd.Series({k: np.nan for k in MODEL_COLUMNS}, dtype=np.float64) else: return pd.Series(x[band])