diff --git a/.gitignore b/.gitignore index 47ac4bd..024f9a2 100644 --- a/.gitignore +++ b/.gitignore @@ -65,7 +65,7 @@ ipython_config.py # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it # in version control. # https://pdm.fming.dev/#use-with-ide -.pdm.toml +.pdm-python # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm __pypackages__/ diff --git a/batdetect2/detector/compute_features.py b/batdetect2/detector/compute_features.py index 6abb145..e0c3a2d 100644 --- a/batdetect2/detector/compute_features.py +++ b/batdetect2/detector/compute_features.py @@ -100,7 +100,7 @@ def compute_max_power_bb( max_power_ind = np.argmax(power_per_freq_band) return int( convert_int_to_freq( - max_power_ind, + y_low - max_power_ind, spec.shape[0], min_freq, max_freq, @@ -190,13 +190,13 @@ def compute_max_power_second( def compute_call_interval( prediction: types.Prediction, - previous_prediction: Optional[types.Prediction] = None, + previous: Optional[types.Prediction] = None, **_, ) -> float: """Compute time between this call and the previous call in seconds.""" - if previous_prediction is None: + if previous is None: return np.nan - return round(prediction["start_time"] - previous_prediction["end_time"], 5) + return round(prediction["start_time"] - previous["end_time"], 5) # NOTE: The order of the features in this dictionary is important. The