From 79b5a9a740eeaec74d3bf22f61aa636f84b93c18 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Sun, 27 Sep 2026 23:52:04 +0200 Subject: filter short climbs --- fietsboek/geo.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fietsboek/geo.py b/fietsboek/geo.py index 4daef06..ee26424 100644 --- a/fietsboek/geo.py +++ b/fietsboek/geo.py @@ -224,7 +224,13 @@ class Path: :return: An iterator over the climbs, represented by the starting index and ending index of points included in the climb. """ - return self._trimmed_climbs() + # After all the post-processing of climbs, it might happen that we get + # climbs shorter than the minimum amount again. Therefore, we do another + # filtering step here. + for (i, j) in self._trimmed_climbs(): + path = Path(self.points[i:j + 1]) + if path.movement_data().length >= CLIMB_MIN_LENGTH: + yield (i, j) def _trimmed_climbs(self): for i, j in self._merged_climbs(): -- cgit v1.2.3