Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,50 @@
## Release v0.10.0 (2026-11-20)

### Breaking Changes

- **Behaviour change:** FIT invalid sentinel values now decode as `None` instead
of numbers — scalars such as `record.cadence` (0xFF) and `record.speed`
(0xFFFF), and invalid elements inside arrays such as unset `time_in_*_zone`
values. Callers must check for `None` before arithmetic or comparisons; an
all-invalid numeric array is returned as a list of `None` so positions survive.
Raw wire values are retained, so re-encoding is byte-identical, and FILE_TYPE
required-field checks now report a required field written as its sentinel as
missing. CSV export changes with it: `FitFile.to_csv` writes an empty value cell
where it previously wrote the sentinel's decoded value (`255` bpm for
`record.cadence`, `65.535` m/s for `record.speed`, `127.5` % for
`battery_soc`), and `to_rows()` returns `None` there, so anything that read
those numbers as data now sees a blank cell.

### Bug Fixes

- `event.data` now also expands the three Profile subfield-gated component sets,
so packed event payloads decode into named fields instead of only a `uint32`:
gear-change events (Di2 / eTap) populate `front_gear_num`, `front_gear`,
`rear_gear_num` and `rear_gear`, Garmin Varia radar threat alerts populate
`radar_threat_level_max`, `radar_threat_count`, `radar_threat_avg_approach_speed`
and `radar_threat_max_approach_speed` (m/s), and `sport_point` events populate
`score` and `opponent_score`. The generator now emits these components from the
bundled Profile spreadsheet; `event.data` keeps its packed wire value, so
re-encoding is unchanged.
- `validate()` and `to_bytes(strict=True)` no longer report WIRE size errors on
records that carry component-expanded fields (`enhanced_speed`,
`enhanced_altitude`) or a reconstructed compressed timestamp. The record size
check now counts only the fields the active definition writes, so a standard
Garmin activity validates with no findings and still re-encodes byte-for-byte,
while a genuinely mismatched definition size is still reported.

Two caller-visible consequences: clearing a field after decode (for example
`record.heart_rate = None`) no longer trips the WIRE size check, because encode
writes the protocol-invalid value at the definition's size; and an Activity
`file_id` no longer has to carry `serial_number`, which Garmin's own activity
files omit and which Garmin's FIT documentation marks optional. `type`,
`manufacturer` and `time_created` are still required.

### Dependencies

- Upgrade the bundled Garmin FIT SDK Profile to 21.222.0. ([#88](https://github.com/shaonianche/python_fit_tool/issues/88))


## Release v0.9.17 (2026-10-28)

### Bug Fixes
Expand Down
8 changes: 0 additions & 8 deletions news/+invalid-values.break

This file was deleted.

13 changes: 0 additions & 13 deletions news/+strict-wire-record-size.bugfix

This file was deleted.

9 changes: 0 additions & 9 deletions news/+subfield-gated-components.bugfix

This file was deleted.

1 change: 0 additions & 1 deletion news/86.dep

This file was deleted.

1 change: 0 additions & 1 deletion news/88.dep

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "fit-tool"
version = "0.9.17"
version = "0.10.0"
description = "A library for reading and writing Garmin FIT files."
readme = "README.md"
license = "BSD-3-Clause"
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading