8080from neo .core import NeoReadWriteError
8181
8282
83-
8483class BlackrockRawIO (BaseRawIO ):
8584 """
8685 Class for reading data in from a file set recorded by the Blackrock (Cerebus) recording system.
@@ -1205,14 +1204,14 @@ def _read_nsx_data_spec_v30_ptp(self, nsx_nb):
12051204 def _read_nev_header (self , spec , filename ):
12061205 """
12071206 Extract nev header information for any specification version.
1208-
1207+
12091208 Parameters
12101209 ----------
12111210 spec : str
12121211 The specification version (e.g., "2.1", "2.2", "2.3", "3.0")
12131212 filename : str
12141213 The NEV filename to read from
1215-
1214+
12161215 Returns
12171216 -------
12181217 nev_basic_header : np.ndarray
@@ -1222,7 +1221,7 @@ def _read_nev_header(self, spec, filename):
12221221 """
12231222 # Note: This function only uses the passed parameters, not self attributes
12241223 # This makes it easy to convert to @staticmethod later
1225-
1224+
12261225 # basic header (same for all versions)
12271226 dt0 = [
12281227 # Set to "NEURALEV"
@@ -1263,10 +1262,9 @@ def _read_nev_header(self, spec, filename):
12631262
12641263 raw_ext_header = np .memmap (filename , offset = offset_dt0 , dtype = dt1 , shape = shape , mode = "r" )
12651264
1266-
12671265 # Get extended header types for this spec
12681266 header_types = NEV_EXT_HEADER_TYPES_BY_SPEC [spec ]
1269-
1267+
12701268 # Parse extended headers by packet type
12711269 # Strategy: view() entire array first, then mask for efficiency
12721270 # Since all NEV extended header packets are fixed-width (32 bytes), temporarily
@@ -1283,7 +1281,7 @@ def _read_nev_header(self, spec, filename):
12831281 def _read_nev_data (self , spec , filename ):
12841282 """
12851283 Extract nev data for any specification version.
1286-
1284+
12871285 Parameters
12881286 ----------
12891287 spec : str
@@ -1333,8 +1331,8 @@ def _read_nev_data(self, spec, filename):
13331331 masks [data_type ] = (min_val <= raw_data ["packet_id" ]) & (raw_data ["packet_id" ] <= max_val )
13341332 else :
13351333 # Equality check
1336- masks [data_type ] = ( raw_data ["packet_id" ] == packet_id_spec )
1337-
1334+ masks [data_type ] = raw_data ["packet_id" ] == packet_id_spec
1335+
13381336 types [data_type ] = data_types [data_type ](packet_size_bytes )
13391337
13401338 event_segment_ids = self ._get_event_segment_ids (raw_data , masks , spec )
@@ -1351,14 +1349,13 @@ def _read_nev_data(self, spec, filename):
13511349
13521350 return data
13531351
1354-
13551352 def _get_reset_event_mask (self , raw_event_data , masks , spec ):
13561353 """
13571354 Extract mask for reset comment events in 2.3 .nev file
13581355 """
13591356 if "Comments" not in masks :
13601357 return np .zeros (len (raw_event_data ), dtype = bool )
1361-
1358+
13621359 restart_mask = np .logical_and (
13631360 masks ["Comments" ],
13641361 raw_event_data ["value" ] == b"\x00 \x00 \x00 \x00 \x00 \x00 critical load restart" ,
@@ -1520,8 +1517,6 @@ def _match_nsx_and_nev_segment_ids(self, nsx_nb):
15201517 if len (ev_ids ):
15211518 ev_ids [:] = np .vectorize (new_nev_segment_id_mapping .__getitem__ )(ev_ids )
15221519
1523-
1524-
15251520 def _nev_params (self , param_name ):
15261521 """
15271522 Returns wanted nev parameter.
0 commit comments