Repository navigation
[IO] Keep writegdf endpoint samples inside the GDF digital range - #849
Conversation
There was a problem hiding this comment.
If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.
Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
|
Claude finished @claude[bot]'s task in 52s —— View job Code review
BlockingNone. Important
NitsNone. Test gapsNone. The new test reads DigMin/DigMax from the written header, which is behaviour visible in the output file. The offsets are correct: the GDF 1.25 signal header is laid out field by field, with DigMin at EEGLAB parity notesNone. Checked for correctness bugs, EEGLAB/BioSig compatibility, GDF header layout, changed-behavior tests, and CLAUDE.md/AGENTS.md compliance. |
|
Review (Claude Fable): needs more work
DetailsWhat was checked Head Is the cause right? Yes. BioSig marks a sample as overflow when it is at or beyond a limit ( Measured with BioSig 3.8.4 in MATLAB R2025b (
For the three files of this branch, the samples read with overflow detection on equal the input exactly (largest absolute difference 0). The pull request body says nothing about a BioSig read, and the issue comment says the fix was not verified against BioSig. This table can be copied into the body so the evidence is where Arno reads it (rule 27). The Python binding itself (libbiosig) is not installed on this Mac, so the check used the MATLAB BioSig, which applies the same inclusive rule. Why "Fixes #847" is too strong. The plan comment in #847 says that files from other tools with samples at DigMin or DigMax "are genuinely saturated by BioSig's convention, so no upstream raw-data path is needed". EEGLAB does not agree with that:
So after this pull request, EEGPrep's own files are safe, and EEGLAB's files still lose samples in the BioSig reader. That remaining part is what the title of #847 describes. It is a behaviour difference from EEGLAB that Arno may want to decide on in #857 or #812, not here. Tests. CI (
Two jobs were still running when this was written (Python 3.13 on Linux, Pyodide). Other open pull requests. Trial merges of this branch with each of the 17 others: no conflict caused by this branch. #857 edits the same test file in other lines and merges cleanly. #835, #797 and #778 conflict with develop itself ( What is needed, exactly
No change to the code is asked. — orchestrator review |
BioSig marks samples at or beyond DigMin/DigMax as overflow and returns NaN, so writegdf now widens each channel's limits by one count. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
72ff9b0 to
3de2e5c
Compare
BioSig overflow detection returns NaN for samples at or beyond a channel's DigMin or DigMax, and writegdf set those limits to the data extremes, so integer endpoint samples read back as NaN. writegdf now leaves one count of headroom on both sides; the stored float64 samples are unchanged. Adds a regression test on the written header and a changelog entry.
This repairs the files EEGPrep writes. The reader side of #847 (a GDF exported by EEGLAB still loses its largest sample when read with overflow detection on) stays open.
Checked with EEGLAB's BioSig 3.8.4 in MATLAB R2025b (
sopenthensread, measured in the review below on head72ff9b04; the code has not changed since):For the three files of this branch, the samples read with overflow detection on equal the input exactly (largest absolute difference 0).
Part of #847
🤖 Generated with Claude Code