From 65d13a32b76fc5868be273d5dabaed7eaabab1e8 Mon Sep 17 00:00:00 2001 From: mbsantiago Date: Mon, 11 Aug 2025 09:46:36 +0100 Subject: [PATCH] Also ignore assertion errors in gallery plotting --- src/batdetect2/plotting/evaluation.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/batdetect2/plotting/evaluation.py b/src/batdetect2/plotting/evaluation.py index b6775d3..bdb2702 100644 --- a/src/batdetect2/plotting/evaluation.py +++ b/src/batdetect2/plotting/evaluation.py @@ -100,7 +100,7 @@ def plot_class_examples( preprocessor=preprocessor, duration=duration, ) - except ValueError: + except (ValueError, AssertionError): continue for index, match in enumerate(false_positives[:n_examples]): @@ -112,7 +112,7 @@ def plot_class_examples( preprocessor=preprocessor, duration=duration, ) - except ValueError: + except (ValueError, AssertionError): continue for index, match in enumerate(false_negatives[:n_examples]): @@ -124,7 +124,7 @@ def plot_class_examples( preprocessor=preprocessor, duration=duration, ) - except ValueError: + except (ValueError, AssertionError): continue for index, match in enumerate(cross_triggers[:n_examples]): @@ -136,7 +136,7 @@ def plot_class_examples( preprocessor=preprocessor, duration=duration, ) - except ValueError: + except (ValueError, AssertionError): continue return fig