From 88db43550fef1f82a4d67a6f6c7995786c061629 Mon Sep 17 00:00:00 2001 From: friendsa <16186646+shaonianche@users.noreply.github.com> Date: Fri, 20 Nov 2026 10:05:48 +0000 Subject: [PATCH] chore(release): prepare 0.10.0 changelog and version bump Bump the package version to 0.10.0 (minor, because this release carries the first Breaking Changes section) and build the changelog from the pending fragments: - invalid FIT sentinel values now decode as None, including the CSV effect - WIRE record-size false errors and the Activity serial_number requirement - subfield-gated event components on event.data - bundled Garmin FIT SDK Profile 21.222.0 news/86.dep is dropped so Dependencies carries the single 21.222.0 line, which supersedes 21.221.0. Amp-Thread-ID: https://ampcode.com/threads/T-01a1f85e-6b0b-7474-bcdb-1fa420219d85 --- CHANGELOG.md | 47 ++++++++++++++++++++++++++ news/+invalid-values.break | 8 ----- news/+strict-wire-record-size.bugfix | 13 ------- news/+subfield-gated-components.bugfix | 9 ----- news/86.dep | 1 - news/88.dep | 1 - pyproject.toml | 2 +- uv.lock | 2 +- 8 files changed, 49 insertions(+), 34 deletions(-) delete mode 100644 news/+invalid-values.break delete mode 100644 news/+strict-wire-record-size.bugfix delete mode 100644 news/+subfield-gated-components.bugfix delete mode 100644 news/86.dep delete mode 100644 news/88.dep diff --git a/CHANGELOG.md b/CHANGELOG.md index 5388e64..9a8fd80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/news/+invalid-values.break b/news/+invalid-values.break deleted file mode 100644 index 3ac6280..0000000 --- a/news/+invalid-values.break +++ /dev/null @@ -1,8 +0,0 @@ -**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. diff --git a/news/+strict-wire-record-size.bugfix b/news/+strict-wire-record-size.bugfix deleted file mode 100644 index 985383e..0000000 --- a/news/+strict-wire-record-size.bugfix +++ /dev/null @@ -1,13 +0,0 @@ -`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. diff --git a/news/+subfield-gated-components.bugfix b/news/+subfield-gated-components.bugfix deleted file mode 100644 index 1ac7cf1..0000000 --- a/news/+subfield-gated-components.bugfix +++ /dev/null @@ -1,9 +0,0 @@ -`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. diff --git a/news/86.dep b/news/86.dep deleted file mode 100644 index e5d2ab2..0000000 --- a/news/86.dep +++ /dev/null @@ -1 +0,0 @@ -Upgrade the bundled Garmin FIT SDK Profile to 21.221.0. diff --git a/news/88.dep b/news/88.dep deleted file mode 100644 index fd99884..0000000 --- a/news/88.dep +++ /dev/null @@ -1 +0,0 @@ -Upgrade the bundled Garmin FIT SDK Profile to 21.222.0. diff --git a/pyproject.toml b/pyproject.toml index 2c82526..36b01d1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/uv.lock b/uv.lock index 39dfb71..fb3db5a 100644 --- a/uv.lock +++ b/uv.lock @@ -338,7 +338,7 @@ wheels = [ [[package]] name = "fit-tool" -version = "0.9.17" +version = "0.10.0" source = { editable = "." } [package.optional-dependencies]