Repository navigation
Fix FIT round-trip fidelity and add enum name mapping - #5
Merged
Merged
Conversation
- Fix FITProfile message numbers and field metadata to match the FIT spec - Add missing decoder base types (uint8z, uint16z, uint32z, byte, 64-bit) - Make FIT->GeoJSON->FIT round-trip content-preserving via a generic profile-driven encoder (laps/events/device_info no longer dropped) - Convert timestamps to ISO8601 in GeoJSON and back on encode - Add FIT enum value->name lookup (FIT.name) with field-name aliases - Add sample FIT test fixture and comprehensive decode/round-trip tests
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
Fixes several correctness bugs in the FIT decoder/encoder and makes the FIT → GeoJSON → FIT round-trip content-preserving.
Changes
Decoder
uint8z,uint16z,uint32z,byte,sint64,uint64,uint64z) that previously fell through to a wrong default.Profile
MesgNumvalues (e.g.lapwas9, now19).file_id,record,lap,session,event,activity,device_info.Round-trip fidelity
FITCoder.readnow emits laps and events as their own Features (previously dropped), and fully populatesfit_device/fit_activity.FITCoder.writeuses a generic profile-driven encoder so every field round-trips (verified: 0 differences vs the original via the Garmin Python SDK).Enum name mapping
FIT.name(for:value:)value → name lookup with field-name aliases (e.g.trigger→session_trigger).FITManufacturer/FITSportTypeenums.Tests
TestData/sample.fitfixture andSampleFITDecodeTestscovering decode, round-trip, and enum mapping.