From bfcab0331e59ff41e228f9930f78e6d97182b60f Mon Sep 17 00:00:00 2001 From: mbsantiago Date: Tue, 22 Apr 2025 09:17:17 +0100 Subject: [PATCH] Attend test warnings --- batdetect2/postprocess/decoding.py | 2 +- tests/test_audio_utils.py | 2 +- tests/test_postprocessing/test_extraction.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/batdetect2/postprocess/decoding.py b/batdetect2/postprocess/decoding.py index 8e1f570..4e62402 100644 --- a/batdetect2/postprocess/decoding.py +++ b/batdetect2/postprocess/decoding.py @@ -93,7 +93,7 @@ def convert_xr_dataset_to_raw_prediction( """ detections = [] - for det_num in range(detection_dataset.dims["detection"]): + for det_num in range(detection_dataset.sizes["detection"]): det_info = detection_dataset.sel(detection=det_num) geom = geometry_builder( diff --git a/tests/test_audio_utils.py b/tests/test_audio_utils.py index 86153aa..6e635e2 100644 --- a/tests/test_audio_utils.py +++ b/tests/test_audio_utils.py @@ -8,7 +8,7 @@ from batdetect2.detector import parameters from batdetect2.utils import audio_utils, detector_utils -@given(duration=st.floats(min_value=0.1, max_value=2)) +@given(duration=st.floats(min_value=0.1, max_value=1)) def test_can_compute_correct_spectrogram_width(duration: float): samplerate = parameters.TARGET_SAMPLERATE_HZ params = parameters.DEFAULT_SPECTROGRAM_PARAMETERS diff --git a/tests/test_postprocessing/test_extraction.py b/tests/test_postprocessing/test_extraction.py index 4e1fa23..125b597 100644 --- a/tests/test_postprocessing/test_extraction.py +++ b/tests/test_postprocessing/test_extraction.py @@ -373,7 +373,7 @@ def test_extract_detection_xr_dataset_empty( assert isinstance(actual_dataset, xr.Dataset) assert "detection" in actual_dataset.dims - assert actual_dataset.dims["detection"] == 0 + assert actual_dataset.sizes["detection"] == 0 assert "scores" in actual_dataset assert actual_dataset["scores"].dims == ("detection",)