Skip to content

Improve FIT file processing: fractional cadence, left/right balance - #8

Merged
tabishm52 merged 1 commit into
mainfrom
fit-processing-improvements
Jul 6, 2026
Merged

tabishm52 merged 1 commit into
mainfrom
fit-processing-improvements

Conversation

@tabishm52

@tabishm52 tabishm52 commented Jul 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Adds add_fractional_columns, which combines FIT's sub-integer fractional_cadence/avg_fractional_cadence/max_fractional_cadence fields into their base cadence/avg_cadence/max_cadence columns, so the fractional fields no longer need to be handled separately downstream.
  • Adds split_left_right_balance, which decodes FIT'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).
  • Updates default_columns.py's defaults accordingly: drops the now-merged fractional columns, replaces left_right_balance with left_balance/right_balance.

Test plan

  • uv run pytest — all tests pass
  • uv run pre-commit run --all-files — ruff, pyright, pytest all pass

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>
@tabishm52
tabishm52 merged commit 873772e into main Jul 6, 2026
4 checks passed
@tabishm52
tabishm52 deleted the fit-processing-improvements branch July 6, 2026 02:14
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