Skip to content

[GUI] Read BioSig files with the optional Python BioSig library - #857

Merged
arnodelorme merged 9 commits into
developfrom
agent/issue-812
Dec 1, 2026
Merged

arnodelorme merged 9 commits into
developfrom
agent/issue-812

Conversation

@arnodelorme

@arnodelorme arnodelorme commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

The BioSig menu now reads EDF, BDF and GDF through Python BioSig. Choosing the menu without the library offers installation in the running environment. The same install action is available in the extension manager. BioSig and MNE each have their own menu.

EEGLAB and EEGPrep BioSig dialogs on Linux

Twenty same-file BDF and EDF numerical comparisons with MATLAB

Install BioSig prompt in a clean Linux environment

All 20 BDF and EDF cases matched the MATLAB event types, event latencies and sampling rates. Signal arrays matched exactly in 18. In the remaining two, MATLAB returned all 16 channels when asked for three. Python returned the requested three. Results by file and option · Fresh GUI installation and import.

Editable Word report · PDF report

Update of November 28, 2026. BIDS import of EDF and BDF files no longer needs BioSig: a small NumPy reader (src/eegprep/plugins/EEG_BIDS/edf_bdf.py) reads them, and gapless EDF+D too. Only an EDF+D file with real gaps still goes to MNE, with a warning. GDF and the BioSig menu keep BioSig. Against EEGLAB in MATLAB R2025b (BIOSIG 3.8.4), the data are identical on five of six test files (0 difference). On the sixth, test.edf, EEGLAB turns the last channel into events and removes it, so it returns 15 channels and the reader 16. On the two annotated EDF+ and BDF+ files the events differ: EEGLAB reads 3 of 5 annotations in the EDF+ file and none in the BDF+ file, and its latencies are one sample earlier, as on develop. The install prompt and the installation page now name the system library and its command (sudo apt install libbiosig-dev on Linux, brew install biosig on macOS). The parity table, the Codex review and what was left are in the review comment. The two questions for Arno are in the Needs Arno comment.

Cause and change

The earlier BioSig-labelled importer read through MNE. The replacement calls BioSig for data and metadata, preserves the BDF trigger events, and keeps channel selection, reference, time range and history explicit. Linux and macOS builds use the native BioSig library. Windows x64 Python has a wheel for the tested versions.

Verification

The final Linux reader, BIDS, menu, dialog and console suite passed 535 tests and 139 GUI subtests. One case was skipped and 83 reference cases were deselected. All 61 targeted installer, importer and Help tests passed. The native library on Ubuntu 22.04 was libbiosig 2.3.3 and the Python package was BioSig 4.0.2. On a fresh environment the GUI installed the binding and opened the BDF file into the shared console workspace (16 channels, 15,360 samples and 41 triggers). With an existing partial MNE 1.13.2 installation, one prompt added all six missing format packages and opened 32 channels × 30,504 samples; a second selector opened without prompting. Pre-commit, Ruff and ty passed. Full MATLAB reference run. The reference pins are EEGLAB d0963be9d81acc5b66e84f8d3d7c89e3ce127cc4 and eeglab_tests fec88f9ffe7c225eb1de8924db8b6a3e0d53a4d9. All 30 Help and optional-extra checks passed on the final installation-guidance change. The numerical comparisons use e965781 and the final change only edits installation guidance. GitHub has accepted the full reference run on this exact branch tip. Its counts and runtime are pending.

Decision for Arno

Honor explicit channel selection. MATLAB’s two channel-list discrepancies are tracked in the reference-side finding. In GDF, the BioSig binding can replace valid digital endpoints with NaN. The program documents this limitation and the unavailable uncalibrated GDF option. GDF endpoint finding.

Related changes are the separate MNE importer and native import menus. The earlier numerical comparison is preserved in issue #701.

Fixes #812
Part of #735

@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 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 29, 2026 •

Copy link
Copy Markdown
Contributor

PR #857 was updated after the trigger (e965781 -> 95e137e). Push again or mention Claude to run on the latest version.

@arnodelorme

Copy link
Copy Markdown
Collaborator Author

Review (Claude Fable): needs Arno

  • Install policy. BioSig on PyPI has wheels for 64-bit Windows only. On Linux and on the Mac, pip install biosig compiles against a system library (libbiosig-dev, or brew install biosig). The prompt does not say so, and BIDS import of EDF and BDF now needs it too.
  • Window. The two checkboxes you asked to drop on November 26 are back, and Enable overflow detection never changes the result.
  • Scope. The MNE-IO menu changes behaviour in this pull request, outside issue 812.
  • Evidence. Captures and histogram are in the body and readable. CI and the MATLAB reference run had no result yet at 03:42 UTC.
Details

Reviewed at 95e137e. The reader itself looks sound, the menu labels and the order (ask to install, then the file chooser) follow EEGLAB's pop_biosig.m, and the fix sits in shared code (ensure_reader_installed), not in one window.

Decisions for Arno

  1. A system library is needed on Linux and on the Mac. PyPI lists biosig-4.0.2 wheels for win_amd64 only, plus the source archive. Consequences of this branch:
    • The prompt reads "Install biosig>=4.0.2 in this Python environment?" (plugin_menu.py L81-L85). Without the system library the build fails and the user sees the last 2500 characters of the pip output, with no word on brew install biosig or libbiosig-dev. Your Mac has no Homebrew biosig today, so the menu would fail there. Suggested: name the system package in the prompt and in the failure box, as the ImportError text already does.
    • BIDS import of EDF and BDF calls pop_biosig (raw.py L66-L68, bids_tools.py L793-L795). On develop this needs eegprep[mne]. After this change, pop_importbids and bids_preproc on EDF or BDF data need a compiled BioSig, which a cluster user without root cannot install with pip alone. Do you want BIDS to keep the MNE reader (pop_mneio), or to follow BioSig?
    • eegprep[all] now includes biosig (pyproject.toml L136-L138). pip install "eegprep[all]" and uv sync --all-extras will fail on Linux and on the Mac without the system library. The CI workflows had to add libbiosig-dev and brew install biosig for that reason. Suggested: leave biosig out of all.
  2. The window. Issue 735 records your answer of November 26 that Enable overflow detection and Force continuous data leave the window, in EEGLAB too. This pull request shows both again (pop_biosig.py L396-L402) and does not mention it.
    • Enable overflow detection has no effect in any case. The option is only read for GDF (L90-L91), where the box is greyed. For EDF and BDF the box is active and ignored. The help text says so, but the window still offers it.
    • Force continuous data now does something EEGLAB's window never does. Cleared, it sends 'blockepoch', 'on' (L68). In pop_biosig.m the cleared box sends 'blockepoch', 'off' (line 187), the same as the default (line 217). The Python behaviour matches the label and the help documents it. It is a deliberate difference from EEGLAB and it needs your yes.
  3. MNE-IO menu. _reader_available now always requires the nine packages of mne-io (plugin_menu.py L62-L69). With MNE installed but without the others (antio, curryreader, mffpy, pymef, pymatreader), develop opens the MNE-IO menu and this branch asks to install them first and stops if the answer is no. Checked here: test_f10_accept_menu_import_updates_shared_session[pop_mneio] passes on develop and fails on this branch in the same environment. This belongs in its own pull request (rule 21).

Work needed whatever you decide

  • Tests without BioSig. Seven reader tests call pop_biosig with no skip when the library is absent, so they fail on any machine without the system library (here: 8 failed, 94 passed on the branch, 1 failed, 96 passed on develop in the same files). Add pytest.importorskip("biosig") to them, as test_plugin_menu.py does for MNE.
  • The 20 cases are test.bdf and test.edf with ten option sets each. test.edf has no event, so the "event latencies match" result rests on the BDF triggers alone. There is no EDF+ file with annotations (the one sample offset of finding F6 in issue 735 is not settled) and no GDF file, though the menu reads both. One case of each would close this.
  • Reference run. The body says the counts and runtime are pending. AGENTS.md asks for them in the body before a core function change is merged. Run 46219936545 was still queued at review time, and so were the CI jobs (only the documentation build had passed).
  • Size. 24 files, 408 lines added and 265 removed. Splitting off point 3 and the BIDS question would bring it closer to a change that can be accepted at a glance.

Minor

  • biosig.data() reads the whole file before the time range is cut (L106), so a data range no longer saves memory on a large file. A limit of the binding, worth one line in the help.
  • Two comments explain workarounds for libbiosig (the JSON header at L86, the calibration limits in _digital_samples). AGENTS.md asks for an issue instead of such comments.
  • The install prompt is a plain grey Qt box, not the EEGLAB blue (rule 10). It came with pull request 842, not with this one.

Other open pull requests. A trial merge with each of the 17 other open pull requests gives no conflict caused by this branch. 845, 835, 797 and 778 conflict, and each already conflicts with develop.

For the orchestrator. Commit 1a74fb9 on develop ("Expose format-specific readers in the import menu", 44 files) belongs to no pull request, and this branch is built on it. Pull request 850, on the same subject, is still open.

— orchestrator review

@arnodelorme

Copy link
Copy Markdown
Collaborator Author

Needs Arno

Two points of this pull request are yours to decide. Nothing was changed in the code for either of them.

1. The two checkboxes that came back in the BioSig window. On November 26 you answered in issue 735 that Enable overflow detection and Force continuous data leave the window, in EEGLAB too. This pull request shows both again. Enable overflow detection changes nothing for EDF and BDF files, and it is greyed for GDF files. Force continuous data, when cleared, cuts the data into epochs ('blockepoch', 'on'), which EEGLAB's own window never does (there a cleared box sends 'blockepoch', 'off', the same as the default). Your choices:

  • (a) Remove both checkboxes, as you decided on November 26.
  • (b) Keep both as they are in this pull request, with the difference from EEGLAB for Force continuous data accepted.
  • (c) Keep only Force continuous data and remove Enable overflow detection, which has no effect.

2. The MNE-IO menu now asks for nine packages. On develop the MNE-IO menu opens as soon as MNE is installed. In this pull request it first asks to install all the packages of the mne-io extra (MNE plus the readers antio, curryreader, mffpy, pymef, pymatreader and the others), and stops when the answer is no. This is outside issue 812, which is about BioSig. Your choices:

  • (a) Take this change out of this pull request, so that the MNE-IO menu behaves as on develop, and open a separate pull request for it if you want it.
  • (b) Keep it here as it is.
  • (c) Keep the check but only ask for the package that the chosen file format needs.

— orchestrator

@arnodelorme

Copy link
Copy Markdown
Collaborator Author
  1. OK, remove overflow but keep Force continuous data

  2. Yes, for installing the 9 packages. However, not by default only when people select mne to install in the extension manager or when one install eegprep with --full option.

@arnodelorme

arnodelorme commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator Author

Code review

This is an independent review by Codex (OpenAI, model gpt-6.1-terra) of the three commits pushed today by the orchestrator (Claude Fable), which answer Arno's request to stop BIDS import of EDF and BDF files from needing BioSig. Codex read the code only and did not run the tests. Its one blocking finding and its important finding are fixed in commit 45c9cbb.

What changed in this pull request

  • BIDS import of EDF and BDF no longer needs BioSig. A small reader written with NumPy (src/eegprep/plugins/EEG_BIDS/edf_bdf.py) decodes the records and applies the BIOSIG calibration. pop_importbids, pop_load_frombids, bids_preproc and the BIDS export wizard use it. The BioSig menu and pop_biosig still use BioSig, and GDF files still need it.
  • The install prompt names the system library. On Linux the BioSig prompt and the failure box now say that libbiosig is needed and give sudo apt install libbiosig-dev. On the Mac they give brew install biosig. Both package names were checked (Ubuntu 22.04 offers libbiosig-dev 2.3.3, Homebrew offers biosig 4.0.2). The installation page has the same two commands.
  • On this Mac, which has no BioSig, the BIDS tests went from 27 failed and 36 passed on the branch to none failed. The affected test files now give 184 passed and 3 skipped.

Parity with EEGLAB (rule of pull request #860). MATLAB R2025b, EEGLAB's pop_biosig(file) with its defaults and BIOSIG 3.8.4, against the new reader, on EEGLAB's two sample recordings and four files written with pyEDFlib (16 and 24 bit, with samples at the digital minimum and maximum, EDF+ and BDF+ annotations).

File Size (channels × samples) Sampling rate Labels Largest data difference Events
test.bdf (EEGLAB sample, BioSemi with Status) 16 × 15,360 256 Hz both same 0 (0 of 245,760 samples differ) 41 and 41, same types and latencies
test.edf (EEGLAB sample) MATLAB 15 × 15,360, new reader 16 × 15,360 256 Hz both same on the 15 0 on the 15 channels MATLAB keeps MATLAB turns the last channel (O2) into 55 events and removes it. The new reader keeps O2 and has no event, as develop does.
plain_512.edf (16 bit) 4 × 2,048 512 Hz both same 0 none in both
plain_256.bdf (24 bit) 4 × 1,024 256 Hz both same 0 none in both
plus_annot.edf (EDF+, 5 annotations) 3 × 1,000 100 Hz both same 0 MATLAB: 3 events at 100, 300.5 and 999. New reader: 5 events at 1, 101, 235.5, 301.5 and 1000.
plus_annot.bdf (BDF+, 5 annotations) 3 × 1,000 100 Hz both same 0 MATLAB: none. New reader: the same 5 events.

The signals are identical to MATLAB, bit for bit, in the six files. Two differences from EEGLAB remain, and both are already on develop, so this change does not add them:

Against develop's reader (MNE) on the same six files: same labels, same event types and latencies. The data differ only by the storage type, since develop returned 64 bit values and EEGLAB and the new reader store 32 bit ones (largest difference 0.0078 µV on a ±262,144 µV range, 3 parts in 100 million). One annotation that runs past the end of the file keeps its full duration (50 samples, as in MATLAB) where MNE cut it to 1 sample.

The scripts and the result files are in ~/GitHub/admin/orchestrator/temp/orders-20261128/857/ on Arno's Mac.

Findings of Codex and what was done

Finding Level Decision
A discontinuous EDF+D or BDF+D file was sent to MNE, which joins the records and loses the timing after a gap (edf_bdf.py, line 41). Blocking Fixed in part, the rest is for Arno. The reader now reads the time stamp of each record. A file marked EDF+D whose records follow each other without a gap is read by the new reader, with no MNE. A file with real gaps still goes to MNE, as Arno asked and as develop does today, and a warning now says that the gaps are dropped. Marking the gaps with boundary events, or refusing these files, is a change of behaviour that needs Arno's word and a comparison with EEGLAB.
With a record count of -1, a file that ends in the middle of a record was accepted and its last partial record dropped (edf_bdf.py, line 58). Important Fixed. The reader now refuses such a file with a clear message.
The discontinuous test only changed the header flag. Test gap Fixed. The test now covers a flagged file without gap (new reader, same data and events) and a file with a 2 second gap (MNE).
No test of a BioSemi Status channel, of an unknown record count, or of the absence of the BioSig package. Test gap Fixed. Three tests were added, one of them runs the import in a separate Python where import biosig fails.
The export wizard test now checks the loading step only, not the whole export. Test gap Left. The earlier test replaced the reader with a fake. With a real EDF file the export stops in pop_saveset, which cannot save a channel whose urchan is empty. The same happens with a file read by pop_mneio, so it is a separate defect that this pull request does not touch. It deserves its own issue.
The check of the prompt text only runs when BioSig is absent. Test gap Left. The prompt is only shown when BioSig is absent, so the existing test cannot do more without a fake.

Still open on this pull request

  • The two questions for Arno in the "Needs Arno" comment above (the two checkboxes, the nine packages of the MNE-IO menu). Nothing was changed for either.
  • Sixteen reader tests (in the five reader test files run here) call pop_biosig directly and fail on a machine without BioSig, as the review of November 29 noted. They pass in CI, where the library is installed.
  • The full EEGLAB reference run should be started again on the new branch tip (45c9cbb) before a merge.
Full text of the Codex review

Summary

Changes needed: discontinuous recordings can lose timing, and a truncated file with an unknown record count can be accepted silently.
The calibration and signed 16 and 24 bit decoding follow the requested formulas. GitHub was unreachable, so the review covers local HEAD only. Tests were not run.

Blocking

Discontinuous timing is lost at edf_bdf.py:41. The installed MNE EDF reader ignores the EDF+D/BDF+D flag and treats records as consecutive. It does not preserve gaps as boundary events, so samples and annotations after a gap can be assigned incorrect times. Preserve the record time stamps and boundaries, or reject these files clearly until that is supported.

Important

Truncated records are silently dropped at edf_bdf.py:58. For record count -1, integer division discards any partial final record and the later truncation check cannot detect it. Check the remainder and report an incomplete record.

Nits

None.

Test gaps

  • test_bids_load_frombids_helpers.py:461 changes only the header flag of a continuous file. Add actual gaps and annotations after them for both EDF+D and BDF+D, and check timing and boundaries.
  • The new tests do not cover a BioSemi Status channel, unknown record count with a partial record, or enforce the absence of the Python BioSig package. Add behavioral cases for these paths.
  • test_file_menu_audit_673.py:661 replaces the exporter workflow test with a private helper test, so it no longer catches a broken wizard export. The prompt assertion at test_plugin_menu.py:550 also runs only when BioSig is absent.

— orchestrator

arnodelorme and others added 2 commits November 29, 2026 00:06
Arno's answers on #857 (November 28, 2026): the BioSig window loses
Enable overflow detection and keeps Force continuous data. The MNE-IO
menu opens once MNE imports and offers MNE alone when it is missing.
The Extension Manager still installs the nine packages of mne-io, and
the full extra now includes mne-io.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
EDF+ annotation onsets count from the header start time. Sample 1 is
at the time stamp of the first data record, so the native BIDS reader
now subtracts it, drops annotations outside the data and clips their
duration at the end, as pop_biosig does. Found by the Gemini review.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@arnodelorme

Copy link
Copy Markdown
Collaborator Author

Code review

This is an independent review by Gemini (Google, model Gemini 4 Carbon, medium effort, through agy) of pull request 857 at commit c23dfb0, the commit that carries out Arno's two answers of November 28. The orchestrator itself runs on Claude Opus 5.5. Gemini read the whole diff against develop and did not run the tests.

Arno's answers. Gemini checked that both are carried out. The Enable overflow detection checkbox and its handling are gone from the BioSig window. Force continuous data when data is stored in blocks stays, and clearing it still means blockepoch on. The MNE-IO import menu opens as soon as MNE imports, and when MNE is missing it offers to install MNE alone. The Extension Manager still installs the nine packages of the mne-io extra, and pip install "eegprep[full]" now includes eegprep[mne-io]. The console's --full flag only shows the legacy menu items and installs nothing, so the full extra is the reading used here.

One blocking finding, fixed in commit a8106d8. The new BIDS reader for EDF and BDF placed EDF+ annotations at onset * srate + 1 without subtracting the time stamp of the first data record. EDF+ counts onsets from the start time in the header, and sample 1 sits at the first record's time stamp. In a file whose first record does not start at 0 s (a cropped recording, or a start time with a fraction of a second), every event came late by that offset, and events near the end fell past the last sample. The reader now subtracts that time stamp, drops annotations that fall outside the data and clips their duration at the end, as pop_biosig does. A new test (test_bids_edf_reader_counts_annotations_from_the_first_record) moves the first record to 1 s and checks the events.

Findings left as they are, none blocking.

  • If a non-compliant EDF file leaves the physical limits blank on its annotation channel, the reader raises an error, and uncalibrated="on" on a channel with equal physical limits would give NaN. Both are rare malformed headers, and pop_biosig behaves the same way.
  • A GDF file saved with an .edf suffix gets its overflow default from the suffix. This is the script option, which stays for EEGLAB compatibility, and the case is unusual.
  • A gapped EDF+D file in a BIDS dataset goes to pop_mneio, whose error without MNE suggests eegprep[mne-io] while the BIDS page says eegprep[mne]. Either install works, and that message is unchanged from develop.
  • BioSig has no wheel for Windows on ARM, so installing it there needs a compiler and libbiosig. The installation page mentions 64-bit Windows only.

Window. Captures of the BioSig window before (45c9cbb) and after this change, for an EDF or BDF file and for a GDF file, are below. They were drawn by Qt on the Mac without showing the window. The window is 30 pixels shorter, and nothing else moved.

BioSig window before and after removing Enable overflow detection

Tests on this Mac. 189 passed on the plugin menu, importer, optional extras, help, File menu and BIDS files. The failures that remain are the tests that need BioSig or defusedxml, which this Mac does not have, and they fail the same way on the previous head. Ruff and pre-commit.py pass.

— orchestrator

@arnodelorme

Copy link
Copy Markdown
Collaborator Author

The orchestrator did not merge this pull request, although Arno's two answers are now carried out (commit c23dfb0) and the blocking finding of the Gemini review is fixed (commit a8106d8). One problem blocks it, and it is Arno's to decide.

BioSig cannot be imported on Windows. The CI job "Test Python 3.12 on windows-latest" fails on the head a8106d8, as it did on the earlier head 95e137e. Sixteen tests that read a file with pop_biosig stop with "A module that was compiled using NumPy 1.x cannot be run in NumPy 2.2.6" and "numpy.core.multiarray failed to import". The BioSig 4.0.2 wheel for 64-bit Windows, which is the latest release on PyPI, was compiled against NumPy 1.x, and EEGPrep requires NumPy 2.1 or newer. So on Windows the BioSig menu would install a package that cannot be imported, and EDF, BDF and GDF import from that menu would stop working there. On develop the same menu reads these files through MNE. Develop does not install BioSig in CI, so this failure comes from this pull request. BIDS import of EDF and BDF is not affected, since it now uses the native reader.

Possible ways forward for Arno. (a) On Windows, keep the BioSig menu reading through MNE until BioSig publishes a wheel built against NumPy 2. (b) Disable the BioSig menu on Windows with a message, and skip its tests there. (c) Wait for a new BioSig release before merging. The other CI jobs were still running when this was written. The installation page also says that the Windows wheel includes the native library, which is true, but it does not work with NumPy 2, and that sentence should change with whichever choice is made.

— orchestrator

@arnodelorme

Copy link
Copy Markdown
Collaborator Author

A short follow-up to the comment above. On the head a8106d8, every CI job passed except "Test Python 3.12 on windows-latest", which failed only because BioSig cannot be imported under NumPy 2 on Windows. After pull request 851 was merged, the branch was brought up to date with develop (commit 6741d33), and the tests of the readers, the menus, the extras and BIDS give the same results on this Mac as before. The pull request stays unmerged until Arno chooses how BioSig should behave on Windows.

— orchestrator

@arnodelorme

Copy link
Copy Markdown
Collaborator Author

Arno asked on November 29, 2026 for a comparison of the two EDF and BDF readers and for a native import menu, and this is now tracked separately from this pull request.

This pull request is unchanged and still waits for Arno's choice about the BioSig menu on Windows.

— orchestrator

@arnodelorme

Copy link
Copy Markdown
Collaborator Author

Arno's choice, November 29, 2026: option (b). His words: "Yes, turn off the menu in Windows with a warning."

  • On Windows, the BioSig import menu is turned off: choosing it shows a warning that says BioSig 4.0.2 on PyPI cannot be imported with NumPy 2 on Windows, and points to the other ways to read EDF, BDF and GDF files (the MNE reader, the native EDF/BDF reader of pull request 868 once merged, or BIDS import).
  • The pop_biosig tests that read a file are skipped on Windows with that same reason, so the Windows CI job passes.
  • The installation page drops the sentence saying the Windows wheel works, and says instead that BioSig is not available on Windows until a wheel built for NumPy 2 is published.
  • Once CI is green, report back here so Arno can merge; the pull request stays for him to merge.

— orchestrator

BioSig 4.0.2 on PyPI ships a Windows wheel built for NumPy 1, and
EEGPrep needs NumPy 2. The import menu now warns and pop_biosig raises
a clear error there, pointing to pop_mneio and BIDS import. Tests that
read files with BioSig skip on Windows (PR 857, Arno, option b).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@arnodelorme

Copy link
Copy Markdown
Collaborator Author

Arno chose option (b), so BioSig is now turned off on Windows. This is commit 00607eb, "fix: turn off BioSig on Windows".

What changed. BioSig 4.0.2, the latest version on PyPI, has a Windows wheel built for NumPy 1, and EEGPrep needs NumPy 2. On Windows (sys.platform == "win32"):

  • Choosing a BioSig import menu, or installing BioSig from the Extension Manager, now shows a warning instead of the install prompt. No file dialog opens. The warning says BioSig cannot be used on Windows yet because its PyPI package was built for NumPy 1, and it points to File > Import data > Using the MNE-IO interface (pop_mneio) and to BIDS import (pop_importbids), which reads EDF and BDF without BioSig. The Extension Manager no longer imports the broken wheel to check whether BioSig is installed.
  • pop_biosig called from a script raises a RuntimeError with the same message, instead of the NumPy import crash. Bad options are still checked first and raise ValueError on every platform.
  • The message lives in one place, eegprep.extras.BIOSIG_WINDOWS_MESSAGE, and biosig_unavailable_message() decides when it applies.
  • The tests that read a file with BioSig, plus the BioSig install prompt test, are skipped on Windows with that message as the reason. The marker is defined once, skip_biosig_on_windows in tests/fixtures.py. The missing-extra test no longer expects the BioSig ImportError on Windows. One new test sets sys.platform to win32 (the repository already patches it in test_iclabel.py and test_runica_matmul.py). It checks the message and the RuntimeError from pop_biosig, and checks that other platforms are not affected.
  • The installation page no longer says the Windows wheel works. It now explains the NumPy 1 problem and names the other readers.

Tests and CI. On this Mac, the changed test files pass except for the BioSig file-reading tests. Those fail here only because BioSig is not installed on this Mac ("No module named 'biosig'"), the same as before this change. A run with the platform set to Windows showed the warning, opened no file dialog and left the session empty. On GitHub, every check passed on 00607eb, including "Test Python 3.12 on windows-latest" (13 min), macOS, both Ubuntu jobs, Ruff and ty, the docs build and the Pyodide job.

The pull request is not merged and waits for Arno.

— 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: read with the biosig Python library, installed from the extension manager

1 participant