From 441ccb3382ea33ad65516723cbac7774a2ec7128 Mon Sep 17 00:00:00 2001 From: mbsantiago Date: Mon, 25 Aug 2025 22:49:48 +0100 Subject: [PATCH] Remove user warning from plotting function --- src/batdetect2/plotting/evaluation.py | 2 +- src/batdetect2/postprocess/remapping.py | 1 - tests/test_features.py | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/batdetect2/plotting/evaluation.py b/src/batdetect2/plotting/evaluation.py index 5abdcd2..6345b35 100644 --- a/src/batdetect2/plotting/evaluation.py +++ b/src/batdetect2/plotting/evaluation.py @@ -156,5 +156,5 @@ def get_binned_sample(matches: List[MatchEvaluation], n_examples: int = 5): bins = pd.qcut(pred_scores, q=n_examples, labels=False, duplicates="drop") df = pd.DataFrame({"indices": indices, "bins": bins}) - sample = df.groupby("bins").apply(lambda x: x.sample(1)) + sample = df.groupby("bins").sample(1) return [matches[ind] for ind in sample["indices"]] diff --git a/src/batdetect2/postprocess/remapping.py b/src/batdetect2/postprocess/remapping.py index 6e1a02e..7eea516 100644 --- a/src/batdetect2/postprocess/remapping.py +++ b/src/batdetect2/postprocess/remapping.py @@ -39,7 +39,6 @@ def map_detection_to_clip( ) -> Detections: duration = end_time - start_time bandwidth = max_freq - min_freq - print(f"{bandwidth=} {min_freq=} {detections.frequencies=}") return Detections( scores=detections.scores, sizes=detections.sizes, diff --git a/tests/test_features.py b/tests/test_features.py index f3eabf1..6aa2016 100644 --- a/tests/test_features.py +++ b/tests/test_features.py @@ -192,8 +192,6 @@ def test_compute_max_power_bb(max_power: int): "high_freq": high_freq, } - print(prediction) - max_power_bb = feats.compute_max_power_bb( prediction, spec,