Skip to content

Commit 60d98bd

Browse files
authored
Fixed typecheck errors
Fixed typecheck errors
1 parent 9a53b51 commit 60d98bd

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

eegnb/devices/eeg.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
"""
77

88
import sys
9-
import time
109
import logging
11-
from time import sleep
10+
from time import sleep, time
1211
from datetime import datetime
1312
from multiprocessing import Process
1413

@@ -27,8 +26,7 @@
2726
EEG_CHANNELS,
2827
)
2928

30-
import socket, json, logging, struct
31-
from time import time
29+
import socket, json, struct
3230

3331

3432
logger = logging.getLogger(__name__)
@@ -152,9 +150,9 @@ def _start_muse(self, duration):
152150
self.recording = Process(target=record, args=(duration, self.save_fn))
153151
self.recording.start()
154152

155-
time.sleep(5)
153+
sleep(5)
156154
self.stream_started = True
157-
self.push_sample([99], timestamp=time.time())
155+
self.push_sample([99], timestamp=time())
158156

159157
def _stop_muse(self):
160158
pass
@@ -517,7 +515,7 @@ def _kf_push_sample(self, timestamp, marker, marker_name):
517515
'packet_sent': data_to_send})
518516

519517
def _stop_kf(self):
520-
518+
521519
self.kf_evnum+=1
522520
kf_stop_timestamp = int(time()*1e6)
523521

eegnb/experiments/rest/eoec.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ def setup(self, instructions: bool = True):
105105

106106

107107
def present_stimulus(self, idx: int):
108+
if self.outlet is None or self.open_sound is None or self.close_sound is None:
109+
raise RuntimeError("setup() must be called before present_stimulus()")
110+
108111
label = self.trials["parameter"].iloc[idx] # 0 open, 1 closed
109112
if self.trials["timestamp"].iloc[idx] == 0:
110113
timestamp = time()

0 commit comments

Comments
 (0)