Skip to content

Fix wfdb_to_mat conversion and prevent sample wrap - #650

Merged
tompollard merged 2 commits into
mainfrom
fix-wfdb-to-mat-release
Nov 21, 2026
Merged

tompollard merged 2 commits into
mainfrom
fix-wfdb-to-mat-release

Conversation

@tompollard

Copy link
Copy Markdown
Member

Summary

This branch brings the contributor's #633 commit onto current main, preserving its authorship, and resolves the conflict with newer converter tests. It adds the range safety fix from #641.

  • Preserve Fix wfdb_to_mat encoding, slicing, and header metadata #633's fixes for channel selection, slicing, MAT encoding and padding, missing samples, and companion header metadata.
  • Check the range of valid samples after the adc_zero shift. Promote to a wider MAT type when needed, including when a shifted valid sample would collide with the missing-value marker.
  • Raise ValueError before writing an output file if the shifted samples cannot fit in the 32-bit WFDB format.
  • Add regression tests for both shift directions, understated adc_res, missing samples, and the 32-bit limit.

Verification

  • Offline suite: 382 passed, 17 network tests deselected.
  • Converter suite: 37 passed; MAT converter tests: 10 passed.
  • Ruff format and lint passed.
  • Sphinx HTML build passed with warnings treated as errors.

The first commit is from #633 by @goktugozkanmd and OpenBot; the second commit addresses #641. This PR supersedes #633 for the release branch.

Closes #641.

goktugozkanmd and others added 2 commits November 21, 2026 15:45
Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
@tompollard
tompollard merged commit 7b6ec43 into main Nov 21, 2026
18 checks passed
@tompollard
tompollard deleted the fix-wfdb-to-mat-release branch November 21, 2026 20:55
tompollard added a commit that referenced this pull request Nov 21, 2026
## Summary

Prepare wfdb 4.4.0 for release.

- Set the package version to 4.4.0.
- Generate the 4.4.0 release notes from all pending changelog fragments.
- Fill the previously empty ADC float32 overflow fragment before
consuming it.

This PR targets `main` now that #650 has merged. Thank you to
@goktugozkanmd for the `wfdb_to_mat` fixes and tests in #633. They were
incorporated into #650 with the original commit authorship preserved,
and are documented in these release notes.

## Checks

- Offline test suite on #650: 382 passed, 17 deselected.
- Ruff check and format check passed.
- Sphinx HTML build with warnings as errors passed.
- `uv build` produced the 4.4.0 sdist and wheel.

No release tag or package publication is included.
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.

wfdb_to_mat silently wraps samples that don't fit the output type

2 participants