Repository navigation
Read format 0 signals as missing - #943
tompollard wants to merge 1 commit into
Conversation
tompollard
left a comment
There was a problem hiding this comment.
The behaviour is right. One change is needed before merging: the specification pin.
Behaviour, as agreed on #935
read_record(..., kind="digital")on the specification'sformat0record gives every sample masked.kind="physical"gives every sample NaN.- Legacy
rdrecordgives NaN for physical values. For digital values it raises "Signal 'a' (channel 0) has format 0 and cannot be represented in a digital legacy Record; use read_record(…)". - A record mixing two format 212 signals with a format 0 one reads the 212 signals normally, and the format 0 column is masked.
- Against
main(0c1a867), my 3,520 single-segment and 976 multi-segment comparisons show no differences. No sample record uses format 0.
To change: the specification pin
tests/spec_conformance.json now pins ad32e32, the head of the unmerged wfdb/wfdb-spec#34. Two problems:
- CI clones the specification and checks out that SHA. If #34 is squash-merged and its branch deleted, the commit is no longer on any branch, and this job fails on
main. - #944 and #945 pin different unmerged commits (
6bcb9ccand697cd4f), so whichever merges second conflicts on this file.
Please merge the adapter change in wfdb-spec first, then pin the resulting commit on wfdb-spec main. See my comment on #945 for the order across the three PRs.
3867219 to
30f194a
Compare
|
Thanks. I agree that the pin should point to a commit reachable from the spec's #940–#942 merged while I was assembling the stack, so #943 is now rebased on current I checked the suggestion to merge all three adapters first. Running #943 against #36's adapter makes the existing |
Fixes #935. This is the first open PR in the Python stack: #943 → #944 → #945. The matching spec adapter is wfdb-spec #34. After that adapter merges, I will pin a commit reachable from spec
main.Behavior differences from 6.1.0
read_recordandread_segmentsreturn a fully masked digital format 0 channel or an all-NaN physical channel, in either layout. Previously they raised an internalKeyError.rdrecord(..., physical=True)returns NaN for format 0;rdrecord(..., physical=False)raises aValueErrornaming the channel and pointing toread_record(..., kind="digital")instead of an internalKeyError.The
format0known gap is removed. Tests cover both kinds, both layouts, mixed records and segmented reads.Verification on the stacked tip: pinned WFDB spec suite (35 passed), parallel offline suite (2,484 passed, 4 skipped), Ruff, and the warnings-as-errors Sphinx docs build.