Skip to content

Skip readings without a device-reported speed instead of falling back - #8

Merged
Jbithell merged 1 commit into
mainfrom
claude/speed-data-noise-analysis-th2uvo
Aug 2, 2026
Merged

Skip readings without a device-reported speed instead of falling back#8
Jbithell merged 1 commit into
mainfrom
claude/speed-data-noise-analysis-th2uvo

Conversation

@Jbithell

@Jbithell Jbithell commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #7. In production, the fallback-with-warning behaviour showed up as:

Some readings are calculated. 457 of 4212 readings for this day didn't include a reported speed from the device, so calculated speed (derived from position samples, which can be noisy) is shown for those instead.

That's a small proportion of readings, and falling back to the position-derived calculation for them just reintroduced the exact GPS-jitter noise the device-speed feature was meant to eliminate.

  • When a device has an input speed unit configured, its own reported speed is now authoritative outright: readings it didn't report a speed for are skipped — not patched with the noisy derived calculation — from the chart, average/max speed, route map, and legend.
  • The warning banner is removed; there's nothing to warn about once the noisy fallback is gone.
  • Devices with no input speed unit configured are unaffected — they keep the original fully-derived behaviour, including GPS-jitter outlier filtering.

Test plan

  • npx tsc -b — no new type errors (same two pre-existing, unrelated errors as before in timingPoints.tsx/timingPointsHistoricComparison.tsx)
  • Locally seeded a device with an input speed unit configured, steady ~6 kt reported speed, and ~14% of readings missing a reported speed (GPS-jittered positions throughout) — Analysis tab now shows a smooth, tight line (6.7–7.1 mph) with no spikes at all, instead of spiking at the previously-fallback points
  • Verified a device with no input speed unit configured is unchanged (still shows the original derived-only behaviour with outlier filtering, e.g. max ~17.6 mph on jittered GPS data)

Generated by Claude Code

When a device has an input speed unit configured, its own reported speed
is trusted outright. Previously, readings the device didn't report a
speed for fell back to the noisy position-derived calculation and
surfaced a warning banner. In production this was a small proportion of
readings (e.g. 457 of 4212), and folding them back in via the derived
calculation just reintroduced the exact GPS-jitter noise this feature was
meant to remove.

Those readings — and the outlier-filtering step they'd otherwise need —
are now skipped entirely from the chart, average/max speed, and route
map, rather than patched with a fallback value. Devices with no input
speed unit configured are unaffected: they keep the original fully-derived
behaviour, GPS-jitter outlier filtering included.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q1tFbZfhQvqCNtbqopqTbM
@Jbithell
Jbithell marked this pull request as ready for review August 2, 2026 15:20
Copilot AI review requested due to automatic review settings August 2, 2026 15:20
@Jbithell
Jbithell merged commit ee4f5d3 into main Aug 2, 2026
@Jbithell
Jbithell deleted the claude/speed-data-noise-analysis-th2uvo branch August 2, 2026 15:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the Analysis tab’s speed handling to avoid reintroducing GPS-jitter noise by no longer falling back to position-derived speed when a device is configured to provide its own speed, and removes the associated warning UX.

Changes:

  • When inputSpeedUnit is configured, route segments without device-reported speed are skipped instead of falling back to derived speed.
  • Removes the “Some readings are calculated” warning banner and related summary fields.
  • Updates chart point inclusion logic to skip points whose segment was filtered out (missing device speed or derived outlier).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +478 to +481
// Once a device has a configured input unit, its own reported speed is authoritative:
// readings it didn't report are skipped outright rather than patched with a noisy
// position-derived guess. Devices with no input unit configured keep the original
// fully-derived behaviour, GPS-jitter outliers and all.
Comment on lines +541 to +550
const chartData = pointsWithDerivedSpeed
.filter((point, index) => index === 0 || resolvedPointIds.has(point.id))
.map((point) => ({
pointId: point.id,
timestampMillis: toMillisTimestamp(point.timestamp),
timestampLabel: displayDateTime(point.timestamp).toFormat("HH:mm"),
speedDisplay: Number(
fromMetersPerSecond(point.speedMps, displaySpeedUnit).toFixed(2),
),
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants