Repository navigation
Coalesce FIT enhanced_* fields into base speed/altitude columns - #4
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
enhanced_altitude/enhanced_speed(and lapenhanced_avg_speed/enhanced_max_speed), omitting their base counterparts entirely — this silently droppedaltitude/speedfrom 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-levelparse_fitis unchanged — both columns remain available to direct callers.## FIT filesREADME 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) — greencoalesce_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 existsgarmin-edge-820-bike.fit,garmin-fenix-5-bike.fit) still pass unchanged