Skip to content

Coalesce FIT enhanced_* fields into base speed/altitude columns - #4

Merged
tabishm52 merged 1 commit into
mainfrom
fit-enhanced-field-coalescing
Jul 5, 2026
Merged

tabishm52 merged 1 commit into
mainfrom
fit-enhanced-field-coalescing

Conversation

@tabishm52

@tabishm52 tabishm52 commented Jul 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Newer devices sometimes write only enhanced_altitude/enhanced_speed (and lap enhanced_avg_speed/enhanced_max_speed), omitting their base counterparts entirely — this silently dropped altitude/speed from canonical output for those files.
  • ActivityParser.parse() now coalesces each enhanced field into its base counterpart (preferring enhanced where present, falling back to base per-row), applied before column selection. Low-level parse_fit is unchanged — both columns remain available to direct callers.
  • Added a ## FIT files README section documenting this and other FIT-parsing notes (fitdecode/profile-driven decoding, unknown-field dropping).

Test plan

  • uv run pre-commit run --all-files (ruff, ruff format, pyright, pytest) — green
  • New unit tests on synthetic DataFrames for coalesce_enhanced_columns: precedence when both present, per-row fallback when enhanced is null, fill when base column is entirely missing, no-op when no enhanced column exists
  • Existing FIT fixture tests (garmin-edge-820-bike.fit, garmin-fenix-5-bike.fit) still pass unchanged

Newer devices sometimes write only enhanced_altitude/enhanced_speed (and
lap enhanced_avg_speed/enhanced_max_speed), omitting their base
counterparts entirely, which silently dropped altitude/speed from
canonical output. ActivityParser.parse() now prefers the enhanced value
where present, falling back to base otherwise; low-level parse_fit is
unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@tabishm52
tabishm52 merged commit c2f407e into main Jul 5, 2026
4 checks passed
@tabishm52
tabishm52 deleted the fit-enhanced-field-coalescing branch July 5, 2026 18:27
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.

1 participant