upgrade garmin fit sdk profile version 21.205.0#32
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a51102c4e9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| field_id=self.ID, | ||
| base_type=BaseType.UINT32, | ||
| offset = 0, | ||
| scale = 1, |
There was a problem hiding this comment.
Use the SDK's 1000 scale for active_time
When reading or writing 21.205 files that include the newly added session active_time field, this generated scale makes the public value and serialized bytes 1000x off: the added Profile_21.205.0.xlsx rows for session/lap/split/split_summary active_time specify scale 1000 with units s, while Field.decode_value divides by scale and encode_value multiplies by it. Please regenerate/fix these new active_time fields with the SDK scale so seconds round-trip correctly.
AGENTS.md reference: AGENTS.md:L64-L65
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Summary
- Updated the Garmin profile loader to preserve numeric spreadsheet cells that are stored as strings, so scale/offset values like
"1000"are parsed before generation. fit_tool/gen/profile.pyL138-L149 fit_tool/gen/profile.pyL220-L224 - Regenerated profile message code so the SDK-provided
active_timescale is now1000, including the reviewed session field. fit_tool/profile/messages/session_message.pyL5739-L5748 - Updated generated
active_timeaccessors to return/set scaled seconds as floats. fit_tool/profile/messages/session_message.pyL2347-L2358 - Added regression coverage to confirm session/lap/split/split_summary
active_timefields decode and encode with the SDK millisecond scale. fit_tool/tests/test_profile.pyL58-L68 - Added a Towncrier bugfix fragment for the scale-generation fix. news/32.bugfixL1
Testing
- ✅
git diff --check - ✅
uv run pytest fit_tool/tests/test_profile.py - ✅
uv run pytest
Committed changes on the current branch with commit ed7e01f and created PR metadata via make_pr titled “Fix generated profile numeric scales for SDK 21.205”.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #32 +/- ##
=======================================
Coverage 89.10% 89.10%
=======================================
Files 21 21
Lines 1404 1404
Branches 300 300
=======================================
Hits 1251 1251
Misses 109 109
Partials 44 44 ☔ View full report in Codecov by Harness. |
Refs #31