From da839cd557759a96901c5d0f39961dd427458112 Mon Sep 17 00:00:00 2001 From: Jacob Williamson Date: Wed, 8 Jan 2025 17:21:52 +0000 Subject: [PATCH] Fix bug found in testing --- src/aa_remove_data/remove_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aa_remove_data/remove_data.py b/src/aa_remove_data/remove_data.py index 6db9ae2..7cfa8a6 100644 --- a/src/aa_remove_data/remove_data.py +++ b/src/aa_remove_data/remove_data.py @@ -109,7 +109,7 @@ def get_index_at_timestamp( between the target timestamp and sample. """ target = seconds * 10**9 + nano - last_diff = target - samples[0].secondsintoyear * 10**9 + samples[0].nano + last_diff = target - (samples[0].secondsintoyear * 10**9 + samples[0].nano) for i, sample in enumerate(samples): diff = target - (sample.secondsintoyear * 10**9 + sample.nano) if abs(last_diff) < abs(diff):