Skip to content

Test for the boundary events at the gaps of an EDF+D file - #19

Open
arnodelorme wants to merge 2 commits into
masterfrom
agent/eeglab-issue-1003
Open

arnodelorme wants to merge 2 commits into
masterfrom
agent/eeglab-issue-1003

Conversation

@arnodelorme

@arnodelorme arnodelorme commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

This adds the example file and the test for the boundary events that pop_biosig must place at the gaps of a discontinuous EDF+D file (issue sccn/eeglab#1003, sccn/eeglab#1003).

Test EEGLAB develop (579a27d0d) EEGLAB with pull request sccn/eeglab#1006
pass_edfplusd_boundaries (new) fails: no boundary passes
the 2 existing tests of unittesting_binary/pop_biosig pass pass
  • Merge order: after the EEGLAB pull request (pop_biosig: boundary event at each gap of EDF+D and BDF+D files eeglab#1006), since the new test fails on develop until then. The automatic tests of this repository run on its eeglab submodule, so the new test stays red here until that submodule points to a develop that holds the change (the usual "updating EEGLAB" commit).
  • Example files: unittesting_binary/pop_biosig/edf_plus_d_gaps.edf (4160 bytes) and its BDF+D twin bdf_plus_d_gaps.bdf (5600 bytes, the same recording with 24-bit samples), written by tools/write_edf_plus_d_gaps.py of sccn/eegprep. It holds 3 channels at 50 Hz in 8 records of 1 second that start at 0, 1, 3, 4, 5.25, 6.25, 7.25 and 10.25 seconds. They sit beside their test and not in unittesting_binary/testfiles, which is stored with Git LFS, so that a raw link gives the file.
  • Expected values, those of EEGPrep's reader in Python (pull request [IO] Import EDF and BDF files with EEGPrep's own reader: BIDS import and File > Import data eegprep#868): boundaries at latencies 100.5, 200.5 and 350.5 with durations 50, 12.5 and 100 samples, and 400 samples whose first channel counts from 1 to 400.
What the test checks
  • The whole file: 400 samples joined, 50 Hz, the three boundaries above (tolerance 1e-9).
  • The BDF+D twin: the same data and the same three boundaries.
  • 'blockrange', [1 6]: samples 51 to 300 and the two boundaries inside the range, at 50.5 and 150.5.
  • A last record that starts 0.75 sample after the end of the one before it gets no boundary, and one that starts 1 sample after it gets a boundary of 1 sample.
  • A NaN in a latency or a duration fails the test.
  • A continuous EDF+ file (S001R01.edf) gets no boundary.
  • Not tested: 'blockepoch', 'on', because that call does not return on this file on EEGLAB develop, with or without the change (reported in issue pop_biosig joins the records of an EDF+D file without a boundary event eeglab#1003).

🤖 Generated with Claude Code

pop_biosig must place a boundary event at each gap of a discontinuous EDF+D file (sccn/eeglab issue 1003). The example file edf_plus_d_gaps.edf comes from sccn/eegprep (tools/write_edf_plus_d_gaps.py) and the expected latencies and durations are those of EEGPrep's reader in Python.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
After the review by Codex GPT-6.1 Terra: the same recording as a BDF+D file, a gap of 0.75 sample (no boundary) and of 1 sample (boundary), and a comparison that fails on NaN.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@arnodelorme

Copy link
Copy Markdown
Contributor Author

The review of this test, with the EEGLAB change, is in sccn/eeglab#1006 (comment) (Codex, model GPT-6.1 Terra). Its finding on this test, a comparison that accepted NaN, is fixed in commit 5b8a3e7, which also adds the BDF+D twin of the example file and gaps of 0.75 and 1 sample.

— orchestrator

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.

1 participant