diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-08-21 15:30:51 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-08-21 15:30:51 +0200 |
| commit | 5e3d39cda5250cb55bc8324bcf96b0ab4b36c47f (patch) | |
| tree | f92fe6f938866688b994c99670e1e27863579255 /ride/difficulty_test.go | |
| parent | 0e27097e3d706e0e5bd761bf35fe301fd119d2a9 (diff) | |
feat: bound climb detection by matched official climbs
Detected climbs no longer absorb an official climb's range: official climbs
matched to the route by coordinates claim their stored start/end range, and
climb detection now runs only in the free regions around them. On ride 263 a
single absorbed Cat 2 ascent is split so creating a first-half official climb
lets the second half be detected on its own.
- ride: add Range, freeRegions, and DetectClimbs(claimed); exclude claimed
ranges so a climb never overlaps one
- official_climb: MatchClimb now bounds-matches purely by coordinates without
needing a detected climb; extract geo.Nearest shared helper
- rideanalysis: Analyze builds claimed climbs from matched official climbs and
detects only in free regions; render official vs unmatched climbs separately
Diffstat (limited to 'ride/difficulty_test.go')
| -rw-r--r-- | ride/difficulty_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ride/difficulty_test.go b/ride/difficulty_test.go index 5773376..05b60f9 100644 --- a/ride/difficulty_test.go +++ b/ride/difficulty_test.go @@ -44,7 +44,7 @@ func TestCotacolExampleRide(t *testing.T) { func TestCotacolClimbNotAtStart(t *testing.T) { r := RideBuilder{precision: 100}.WithSection("1km at 0%").WithSection("2km at 7%").Build() - climbs := r.AllClimbs() + climbs := r.DetectClimbs(nil) assert.Len(t, climbs, 1) assert.InDelta(t, 98.0, climbs[0].DifficultyScore(), 1e-9) } @@ -78,7 +78,7 @@ func TestCategoryOfBoundaries(t *testing.T) { func TestCotacolHautacamClimbfinderReference(t *testing.T) { r, err := ride.ParseFile(parser, "../examples/2022-07-21.Pogacar.gpx") assert.NoError(t, err) - climbs := r.AllClimbs() + climbs := r.DetectClimbs(nil) assert.Len(t, climbs, 6) hautacam := climbs[5] assert.InDelta(t, 128.6, hautacam.StartDistanceM()/1000, 0.1) |
