Commit 01340d0 1 parent f6de923 commit 01340d0 Copy full SHA for 01340d0
File tree 3 files changed +18
-6
lines changed
3 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -177,11 +177,19 @@ def _reset_inlet(self) -> None:
177
177
results : list [pylsl .StreamInfo ] = self .STATE .resolver .results ()
178
178
for strm_info in results :
179
179
b_match = True
180
- b_match = b_match and ((not self .SETTINGS .info .name ) or strm_info .name () == self .SETTINGS .info .name )
181
- b_match = b_match and ((not self .SETTINGS .info .type ) or strm_info .type () == self .SETTINGS .info .type )
180
+ b_match = b_match and (
181
+ (not self .SETTINGS .info .name )
182
+ or strm_info .name () == self .SETTINGS .info .name
183
+ )
184
+ b_match = b_match and (
185
+ (not self .SETTINGS .info .type )
186
+ or strm_info .type () == self .SETTINGS .info .type
187
+ )
182
188
if b_match :
183
189
self .STATE .inlet = pylsl .StreamInlet (
184
- strm_info , max_chunklen = 1 , processing_flags = self .SETTINGS .processing_flags
190
+ strm_info ,
191
+ max_chunklen = 1 ,
192
+ processing_flags = self .SETTINGS .processing_flags ,
185
193
)
186
194
break
187
195
@@ -195,7 +203,8 @@ def _reset_inlet(self) -> None:
195
203
if fmt in fmt2npdtype :
196
204
dtype = fmt2npdtype [fmt ]
197
205
n_buff = (
198
- int (self .SETTINGS .local_buffer_dur * inlet_info .nominal_srate ()) or 1000
206
+ int (self .SETTINGS .local_buffer_dur * inlet_info .nominal_srate ())
207
+ or 1000
199
208
)
200
209
self ._fetch_buffer = np .zeros ((n_buff , n_ch ), dtype = dtype )
201
210
ch_labels = []
Original file line number Diff line number Diff line change @@ -77,4 +77,3 @@ async def lsl_outlet(self, arr: AxisArray) -> None:
77
77
dat = np .moveaxis (dat , arr .dims .index ("time" ), 0 )
78
78
79
79
self .STATE .outlet .push_chunk (dat .reshape (dat .shape [0 ], - 1 ))
80
-
Original file line number Diff line number Diff line change 2
2
These unit tests aren't really testable in a runner without a complicated setup with inlets and outlets.
3
3
This code exists mostly to use during development and debugging.
4
4
"""
5
+
5
6
import asyncio
6
7
import json
7
8
import os
@@ -36,7 +37,10 @@ async def switch_stream(self) -> typing.AsyncGenerator:
36
37
if switch_counter % 2 == 0 :
37
38
yield self .OUTPUT_SETTINGS , LSLInletSettings (info = LSLInfo (type = "ECoG" ))
38
39
else :
39
- yield self .OUTPUT_SETTINGS , LSLInletSettings (info = LSLInfo (type = "Markers" ))
40
+ yield (
41
+ self .OUTPUT_SETTINGS ,
42
+ LSLInletSettings (info = LSLInfo (type = "Markers" )),
43
+ )
40
44
switch_counter += 1
41
45
await asyncio .sleep (2 )
42
46
You can’t perform that action at this time.
0 commit comments