Repository navigation
Check multi-segment master channel counts - #807
Merged
Merged
Conversation
tompollard
commented
Nov 30, 2026
tompollard
left a comment
Member
Author
There was a problem hiding this comment.
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.
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
Have
wfdb check,check_record, andcheck_datasetcompare 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_channelsissue 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.wfdbarchives.Fixes #806.
Verification