From fa63602897a1dbe682e3cf1cbcb1af0d22c0c859 Mon Sep 17 00:00:00 2001 From: Ben Pettit Date: Sun, 14 Dec 2025 00:04:17 +1000 Subject: [PATCH] simplify code and fix setting duration by removing redundant variable --- eegnb/experiments/Experiment.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/eegnb/experiments/Experiment.py b/eegnb/experiments/Experiment.py index c2a006cc..fb8b9ae5 100644 --- a/eegnb/experiments/Experiment.py +++ b/eegnb/experiments/Experiment.py @@ -72,8 +72,7 @@ def __init__(self, exp_name, duration, eeg, save_fn, n_trials: int, iti: float, self.use_fullscr = use_fullscr self.window_size = [1600,800] - # Initializing the record duration and the marker names - self.record_duration = np.float32(self.duration) + # Initializing the marker names self.markernames = [1, 2] # Setting up the trial and parameter list @@ -320,14 +319,14 @@ def run(self, instructions=True): if self.eeg: if self.eeg.backend not in ['serialport']: print("Wait for the EEG-stream to start...") - self.eeg.start(self.save_fn, duration=self.record_duration + 5) + self.eeg.start(self.save_fn, duration=self.duration + 5) print("EEG Stream started") # Record experiment until a key is pressed or duration has expired. record_start_time = time() - + # Run the trial loop - self._run_trial_loop(record_start_time, self.record_duration) + self._run_trial_loop(record_start_time, self.duration) # Clearing the screen for the next trial event.clearEvents()