Repository navigation
Improve FIT file processing: fractional cadence, left/right balance - #8
Merged
Merged
Conversation
FIT stores cadence's sub-integer precision in a separate fractional_cadence field, and Garmin's UI shows pedal power balance as left/right percentages, but this package previously passed both through undecoded/unmerged. Adds add_fractional_columns, which combines fractional cadence into the base cadence columns, and split_left_right_balance, which decodes the FIT SDK's bit-packed left_right_balance byte (bit 0x80 flags which side the remaining 7 bits' percentage applies to) into left_balance/right_balance percentage columns (0-100, summing to 100). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
3 tasks done
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
add_fractional_columns, which combines FIT's sub-integerfractional_cadence/avg_fractional_cadence/max_fractional_cadencefields into their basecadence/avg_cadence/max_cadencecolumns, so the fractional fields no longer need to be handled separately downstream.split_left_right_balance, which decodes FIT's bit-packedleft_right_balancebyte (bit0x80flags which side the remaining 7 bits' percentage applies to) intoleft_balance/right_balancepercentage columns (0-100, summing to 100).default_columns.py's defaults accordingly: drops the now-merged fractional columns, replacesleft_right_balancewithleft_balance/right_balance.Test plan
uv run pytest— all tests passuv run pre-commit run --all-files— ruff, pyright, pytest all pass