From e54e2b313a37c2d2af4e3e537ad4e64e8c816e86 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Tue, 25 Aug 2026 11:34:27 +0200 Subject: Remove per-index ride accessors now dead after the component migration The DistanceM, ElevationM, Coord, Timestamp and optional metric index accessors (HeartRateBpm, CadenceRpm, PowerW) are no longer used by any production code now that algorithms and consumers read ride components. Tests that asserted metric parsing and coordinates now read the component slices (Distances, Coords, HeartRates, Cadences, Powers). --- ride/ride.go | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'ride/ride.go') diff --git a/ride/ride.go b/ride/ride.go index a694df9..1de8b07 100644 --- a/ride/ride.go +++ b/ride/ride.go @@ -59,26 +59,6 @@ func (r Ride) Cadences() ([]float64, bool) { return optionalComponent(r.cadences func (r Ride) HeartRates() ([]float64, bool) { return optionalComponent(r.heartRates) } -func (r Ride) DistanceM(i int) float64 { return r.distances[i] } - -func (r Ride) ElevationM(i int) float64 { return r.elevations[i] } - -func (r Ride) Coord(i int) geodist.Coord { return r.coords[i] } - -func (r Ride) Timestamp(i int) time.Time { return r.timestamps[i] } - -func (r Ride) HeartRateBpm(i int) (float64, bool) { - return optionalMetric(r.heartRates, i) -} - -func (r Ride) CadenceRpm(i int) (float64, bool) { - return optionalMetric(r.cadences, i) -} - -func (r Ride) PowerW(i int) (float64, bool) { - return optionalMetric(r.powers, i) -} - func optionalComponent(column []float64) ([]float64, bool) { if len(column) == 0 { return nil, false @@ -86,13 +66,6 @@ func optionalComponent(column []float64) ([]float64, bool) { return column, true } -func optionalMetric(column []float64, i int) (float64, bool) { - if len(column) == 0 { - return 0, false - } - return column[i], true -} - type RideParser interface { Parse(reader io.Reader) (Ride, error) } -- cgit v1.3