Repository navigation
Fix: defer GUI imports in CLI and log BrainFlow session errors (#289) - #348
Open
ShakeelAhmed-NeuroAI wants to merge 2 commits into
Open
ShakeelAhmed-NeuroAI wants to merge 2 commits into
ShakeelAhmed-NeuroAI wants to merge 2 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #289
Summary
Addresses silent CLI exits and missing error diagnostics during interactive board selection (
eegnb runexp -ip), particularly when initializing native Bluetooth BrainFlow devices (such asmuse2_bfn) on Windows:eegnb/cli/__main__.py: Movedcheck_reportandpipelinesimports out of module top-level into the functions that use them so PsychoPy/GUI subsystems do not initialize Windows COM in Single-Threaded Apartment (STA) mode before BrainFlow'sSimpleBLEscans for BLE adapters. Also fixed a missingprint()call on unrecognized signal-quality input.eegnb/devices/eeg.py: WrappedBoardShim.prepare_session()in_init_brainflow()to log a clear error message with device name, board ID, and BLE/serial troubleshooting hints onBrainFlowError, and cleanly release any partially prepared session before re-raising.tests/test_cli_device_init.py): Added unit tests verifying lazy CLI imports andBrainFlowErrorlogging/cleanup behavior.