Skip to content

[IO] Read BDF Status triggers when pop_biosig channels omit Status - #748

Merged
arnodelorme merged 3 commits into
developfrom
agent/20261127-fix-747
Nov 27, 2026
Merged

arnodelorme merged 3 commits into
developfrom
agent/20261127-fix-747

Conversation

@claude

@claude claude Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

pop_biosig now decodes BioSemi triggers from the file's Status channel even when the channels option leaves it out, matching EEGLAB, which returns the 41 events of test.bdf for channels [1 2 3]. Removal of Status still applies only when it was loaded. Adds a regression test on a synthetic BDF.

Fixes #747

🤖 Generated with Claude Code

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

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

claude Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Claude finished @claude[bot]'s task in 51s —— View job


Code review

  • Overall assessment: The code change is correct and small. It does what the title says: when channels leaves Status out, BioSemi triggers are still decoded from the file's Status channel, and Status is removed only when it was actually loaded.
  • Highest-risk area: Merge process. This changes an EEGLAB-ported core function (pop_biosig), and the PR body has no EEGLAB reference-suite evidence yet.
  • Merge recommendation: Needs changes (PR description only).

Blocking

None.

Important

  • The PR body is missing the EEGLAB reference run. AGENTS.md (Testing) says that before merging a PR that changes core function implementations, the author must trigger .github/workflows/eeglab-reference.yml on the branch or run the suite locally once with --eeglab-backend=matlab. The PR description must then include the exact command or workflow run, the EEGLAB and eeglab_tests commits, pass/fail/skip counts, runtime, and the reason for any failures or skips.
    • src/eegprep/functions/popfunc/pop_biosig.py is EEGLAB-ported processing code.
    • The body says EEGLAB "returns the 41 events of test.bdf for channels [1 2 3]", but it does not show the run that backs this.
    • Fix: dispatch the EEGLAB reference workflow on agent/20261127-fix-747 and add the results to the PR body. A human must also approve before merge.

Nits

None.

Test gaps

None. test_pop_biosig_reads_status_events_when_channel_list_omits_status covers the three cases that matter:

  • the loaded channels are exactly A1 and A2, so nothing wrong is dropped when Status is absent;
  • the triggers are decoded, with type and 1-based latency ((5, 3), (7, 7));
  • importevent="off" still turns event import off.

EEGLAB parity notes

  • In EEGLAB, pop_biosig gets its events from BIOSIG sopen's HDR.EVENT. sopen builds those from the whole file's Status channel, whatever channels you select, so decoding from file_labels instead of the loaded chanlocs matches it. I could not open pop_biosig.m to cite line numbers, because the vendored EEGLAB tree is not in this checkout.
  • The second header read (openbdf in _import_bdf_status_channel, then again in _blockrange_status_events) parses only the header. It costs almost nothing and is not worth restructuring.
  • The blockrange latency handling, the mode-7 anchor and the rmeventchan semantics are unchanged.

Checked: correctness of the label lookup split (file labels vs loaded chanlocs), the non-BioSemi early return, importevent/rmeventchan interaction, docs/help sync (interactive_pop_workflows.rst, resources/help/pop_biosig.md), and AGENTS.md compliance. The comment at pop_biosig.py:219 explains EEGLAB parity, which AGENTS.md allows. I could not run the test file in this environment: the sandbox denied pytest.

@arnodelorme

Copy link
Copy Markdown
Collaborator

This pull request and #751 fix the same issue (#747) with the same code. I kept this one because it also updates the pop_biosig help and the workflow page and tests that importevent "off" still turns the events off. I added the changelog entry it was missing and wrapped the long lines in the docs (commit e6b53c6). The bdf and reader tests pass locally (20 passed). The EEGLAB reference run that AGENTS.md asks for is started: https://github.com/sccn/eegprep/actions/runs/45951375826. #751 can be closed once this one is merged.

— 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.

pop_biosig: a channel list that leaves out Status loses the BDF events

1 participant