Skip to content

Port Neuroscan CNT loader tests - #354

Merged
arnodelorme merged 1 commit into
work/testports-legacy-ica-stackedfrom
work/testports-cnt-loader-stacked
Sep 19, 2026
Merged

arnodelorme merged 1 commit into
work/testports-legacy-ica-stackedfrom
work/testports-cnt-loader-stacked

Conversation

@suraj-ranganath

Copy link
Copy Markdown
Member

Ports both current CNT wrapper methods and all 16 underlying loader calls into deterministic pytest coverage. Adds standalone 16/32-bit Neuroscan CNT loading, calibrated partial and blocked reads, event tables, memory-mapped output, File-IO integration, and fixes several credible upstream offset and block-width defects.

@suraj-ranganath

Copy link
Copy Markdown
Member Author

🤖 Problem

The current EEGLAB suite invokes sixteen Neuroscan CNT loading variants through two wrappers, but the tests contain no assertions and EEGPrep previously routed CNT files through ambiguous generic detection. Upstream loader behavior also mishandles several offsets and blocked int32 reads.

Approach

Implement a standalone specification-level CNT reader for 16/32-bit data, calibrated and raw reads, exact partial ranges, channel-blocked storage, event tables 1–3, and optional .fdt-backed output. Add the pop wrapper and File-IO route, and turn every upstream call into observable assertions.

Key code

src/eegprep/functions/sigprocfunc/loadcnt.py parses setup/channel/event records and reads exact channel-major ranges. src/eegprep/functions/popfunc/pop_loadcnt.py constructs synchronized EEG fields, events, and history. tests/test_cnt_eeglab_tests.py generates deterministic CNT fixtures and checks all current cases plus boundary behavior.

Tests

19 focused tests pass, and integration with BDF plus File-IO passes 76 tests with two expected MATLAB skips. The isolated branch passed a 2,298-test broad run and matched the real upstream int32 fixture exactly; int16 scaling was within one float32 ULP. Ruff, ty, staged pre-commit, and Sphinx pass.

@claude

claude Bot commented Sep 14, 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-cnt-loader-stacked branch from eac7a7b to d51f3c1 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-cnt-loader-stacked branch from d51f3c1 to 2fb938b Compare September 14, 2026 10:22
@suraj-ranganath
suraj-ranganath force-pushed the work/testports-cnt-loader-stacked branch from 2fb938b to 6cda3b5 Compare September 14, 2026 10:44
@arnodelorme
arnodelorme merged commit 5a22f48 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