Skip to content

Check multi-segment master channel counts - #807

Merged
tompollard merged 1 commit into
mainfrom
fix/check-multisegment-channel-count
Nov 30, 2026
Merged

tompollard merged 1 commit into
mainfrom
fix/check-multisegment-channel-count

Conversation

@tompollard

Copy link
Copy Markdown
Member

Summary

Have wfdb check, check_record, and check_dataset compare a multi-segment master header's declared channel count with the header that defines its channels. For fixed layout, the checker finds any segment whose count differs from the master, reporting the first mismatch once per record. For variable layout, it compares the master with the zero-length layout header; data segments may still contain a subset of channels.

The new segment_channels issue names the master and observed counts and the offending segment. Existing checks for differences among fixed-layout segments remain in place. The change works for separate WFDB files and .wfdb archives.

Fixes #806.

Verification

  • Full offline suite: 1,394 passed, 4 skipped, 22 deselected.
  • Ruff format and lint passed.
  • Strict Sphinx HTML build passed.

@tompollard tompollard left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this fixes #806. On copies of the sample records with the master signal count changed to 9, 041s reports Master header declares 9 channels; segment '041s01' declares 7, both as files and as a .wfdb archive, and p000878 reports the same against 3269321_layout (4). Running check_dataset("sample-data") gives the same 31 issues on main and this branch, so the real fixed- and variable-layout records (041s, fixed1, p000878, s00001, s25047) don't trigger it. Allowing variable-layout data segments to hold a subset, and reporting a later fixed-layout mismatch once, both look right. The offline suite, Ruff and the strict docs build pass locally.

Ready to merge once CI is green.

@tompollard
tompollard merged commit 7e0df74 into main Nov 30, 2026
19 checks passed
@tompollard
tompollard deleted the fix/check-multisegment-channel-count branch November 30, 2026 20:25
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 check misses multi-segment master channel count mismatches

1 participant