Skip to content

Port low-level BDF record tests - #352

Merged
arnodelorme merged 1 commit into
work/testports-mmo-memmap-stackedfrom
work/testports-bdf-records-stacked
Sep 19, 2026
Merged

arnodelorme merged 1 commit into
work/testports-mmo-memmap-stackedfrom
work/testports-bdf-records-stacked

Conversation

@suraj-ranganath

Copy link
Copy Markdown
Member

Ports every current openbdf and readbdf wrapper method into substantive pytest coverage and adds standalone signed 24-bit BDF record access. The implementation corrects EEGLAB's two-byte unknown-record calculation, validates calibration and record indexing, and handles variable per-channel sample counts without a runtime EEGLAB dependency.

@suraj-ranganath

Copy link
Copy Markdown
Member Author

🤖 Problem

The current EEGLAB suite covers record-level BDF parsing and selected-record reads, but EEGPrep only exposed higher-level BDF workflows. The upstream unknown-record test is commented out and the MATLAB implementation incorrectly divides BDF payload bytes by two instead of three.

Approach

Add standalone openbdf/readbdf APIs that retain familiar header fields without leaking an open descriptor. Parse fixed and per-signal headers, derive calibration, infer complete records from three-byte samples, decode signed 24-bit values, and support calibrated/raw plus padded/compact legacy modes.

Key code

src/eegprep/functions/sigprocfunc/openbdf.py owns header parsing and calibration. src/eegprep/functions/sigprocfunc/readbdf.py owns indexed record decoding. tests/test_bdf_records_eeglab_tests.py maps all eight current wrapper methods and strengthens weak/commented cases with deterministic generated files.

Tests

10 focused and 26 adjacent tests pass. The full non-MATLAB suite reports 2,865 passed, 262 skipped, one expected xfail, and 400 subtests. Ruff check, ty, staged pre-commit, and Sphinx dummy build also pass; repo-wide format check only reports the pre-existing tests/test_pop_reref.py difference.

@claude

claude Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@suraj-ranganath
suraj-ranganath marked this pull request as ready for review September 14, 2026 10:09
@suraj-ranganath
suraj-ranganath force-pushed the work/testports-bdf-records-stacked branch from 474294e to 5c7bbb6 Compare September 14, 2026 10:09

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

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's credit balance is too low for Code Review to run.

An organization admin can purchase credits or upgrade the plan in Plans & Billing.

Once credits are available, reopen this pull request to trigger a review.

@suraj-ranganath
suraj-ranganath force-pushed the work/testports-bdf-records-stacked branch from 5c7bbb6 to 232e3c1 Compare September 14, 2026 10:22
@suraj-ranganath
suraj-ranganath force-pushed the work/testports-bdf-records-stacked branch from 232e3c1 to f4c4d0f Compare September 14, 2026 10:44
@arnodelorme
arnodelorme merged commit 6690e67 into develop Sep 19, 2026
9 checks passed
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.

2 participants