diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-08-25 11:34:27 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-08-25 11:34:27 +0200 |
| commit | e54e2b313a37c2d2af4e3e537ad4e64e8c816e86 (patch) | |
| tree | 37eed4e86668f3854c9dacb0edf5d95e0efceaca /ride/ride.go | |
| parent | 708f5428968b7c1526f257b683d0146ef5dae418 (diff) | |
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).
Diffstat (limited to 'ride/ride.go')
| -rw-r--r-- | ride/ride.go | 27 |
1 files changed, 0 insertions, 27 deletions
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) } |
