From 1a5b3e4cdb5d39444d3e9790e6e473ea28eec9c4 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 30 Nov 2025 09:04:59 +0000 Subject: [PATCH 1/2] Fix early return bug in Experiment.py setup() method The setup() method was incorrectly returning early when instructions were shown (line 128), preventing the rest of the setup code from executing. This meant the EEG initialization and other setup steps were skipped when instructions=True. Changed line 128 from 'return self.show_instructions()' to 'self.show_instructions()' to allow setup to complete properly. --- eegnb/experiments/Experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eegnb/experiments/Experiment.py b/eegnb/experiments/Experiment.py index bb0bf22c..b5515af5 100644 --- a/eegnb/experiments/Experiment.py +++ b/eegnb/experiments/Experiment.py @@ -125,7 +125,7 @@ def setup(self, instructions=True): # Show Instruction Screen if not skipped by the user if instructions: - return self.show_instructions() + self.show_instructions() # Checking for EEG to setup the EEG stream if self.eeg: From 67922b04edfc58647bb94840082c1893f1e6af18 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 30 Nov 2025 09:12:48 +0000 Subject: [PATCH 2/2] Correct fix: Handle show_instructions() return value properly The previous fix was incomplete. show_instructions() returns False when the user cancels and True when they proceed. The setup() method should return False if the user cancels, but continue with the rest of the setup if they proceed. Changed to check the return value and only return early if False. --- eegnb/experiments/Experiment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eegnb/experiments/Experiment.py b/eegnb/experiments/Experiment.py index b5515af5..87ccaaae 100644 --- a/eegnb/experiments/Experiment.py +++ b/eegnb/experiments/Experiment.py @@ -125,7 +125,8 @@ def setup(self, instructions=True): # Show Instruction Screen if not skipped by the user if instructions: - self.show_instructions() + if not self.show_instructions(): + return False # Checking for EEG to setup the EEG stream if self.eeg: