@@ -50,7 +50,7 @@ def _parse_header(self):
5050 self .file = nix .File .open (self .filename , nix .FileMode .ReadOnly )
5151 sig_channels = []
5252 size_list = []
53- for bl in self .file .sects :
53+ for bl in self .file .blocks :
5454 for seg in bl .groups :
5555 for da_idx , da in enumerate (seg .data_arrays ):
5656 if da .type == "neo.analogsignal" :
@@ -80,7 +80,7 @@ def _parse_header(self):
8080 unit_channels = []
8181 unit_name = ""
8282 unit_id = ""
83- for bl in self .file .sects :
83+ for bl in self .file .blocks :
8484 for seg in bl .groups :
8585 for mt in seg .multi_tags :
8686 if mt .type == "neo.spiketrain" :
@@ -110,7 +110,7 @@ def _parse_header(self):
110110 event_channels = []
111111 event_count = 0
112112 epoch_count = 0
113- for bl in self .file .sects :
113+ for bl in self .file .blocks :
114114 for seg in bl .groups :
115115 for mt in seg .multi_tags :
116116 if mt .type == "neo.event" :
@@ -130,7 +130,7 @@ def _parse_header(self):
130130 event_channels = np .array (event_channels , dtype = _event_channel_dtype )
131131
132132 self .da_list = {'blocks' : []}
133- for block_index , blk in enumerate (self .file .sects ):
133+ for block_index , blk in enumerate (self .file .blocks ):
134134 d = {'segments' : []}
135135 self .da_list ['blocks' ].append (d )
136136 for seg_index , seg in enumerate (blk .groups ):
@@ -151,7 +151,7 @@ def _parse_header(self):
151151 segment ['ch_name' ] = da_name_list
152152
153153 self .unit_list = {'blocks' : []}
154- for block_index , blk in enumerate (self .file .sects ):
154+ for block_index , blk in enumerate (self .file .blocks ):
155155 d = {'segments' : []}
156156 self .unit_list ['blocks' ].append (d )
157157 for seg_index , seg in enumerate (blk .groups ):
@@ -181,14 +181,14 @@ def _parse_header(self):
181181 st_idx += 1
182182
183183 self .header = {}
184- self .header ['nb_block' ] = len (self .file .sects )
185- self .header ['nb_segment' ] = [len (bl .groups ) for bl in self .file .sects ]
184+ self .header ['nb_block' ] = len (self .file .blocks )
185+ self .header ['nb_segment' ] = [len (bl .groups ) for bl in self .file .blocks ]
186186 self .header ['signal_channels' ] = sig_channels
187187 self .header ['unit_channels' ] = unit_channels
188188 self .header ['event_channels' ] = event_channels
189189
190190 self ._generate_minimal_annotations ()
191- for blk_idx , blk in enumerate (self .file .sects ):
191+ for blk_idx , blk in enumerate (self .file .blocks ):
192192 bl_ann = self .raw_annotations ['blocks' ][blk_idx ]
193193 props = blk .metadata .inherited_properties ()
194194 bl_ann .update (self ._filter_properties (props , "block" ))
@@ -233,14 +233,14 @@ def _parse_header(self):
233233
234234 def _segment_t_start (self , block_index , seg_index ):
235235 t_start = 0
236- for mt in self .file .sects [block_index ].groups [seg_index ].multi_tags :
236+ for mt in self .file .blocks [block_index ].groups [seg_index ].multi_tags :
237237 if mt .type == "neo.spiketrain" :
238238 t_start = mt .metadata ['t_start' ]
239239 return t_start
240240
241241 def _segment_t_stop (self , block_index , seg_index ):
242242 t_stop = 0
243- for mt in self .file .sects [block_index ].groups [seg_index ].multi_tags :
243+ for mt in self .file .blocks [block_index ].groups [seg_index ].multi_tags :
244244 if mt .type == "neo.spiketrain" :
245245 t_stop = mt .metadata ['t_stop' ]
246246 return t_stop
@@ -258,7 +258,7 @@ def _get_signal_t_start(self, block_index, seg_index, channel_indexes):
258258 if channel_indexes is None :
259259 channel_indexes = list (range (self .header ['signal_channels' ].size ))
260260 ch_idx = channel_indexes [0 ]
261- block = self .file .sects [block_index ]
261+ block = self .file .blocks [block_index ]
262262 das = [da for da in block .groups [seg_index ].data_arrays ]
263263 da = das [ch_idx ]
264264 sig_t_start = float (da .metadata ['t_start' ])
@@ -290,7 +290,7 @@ def _get_analogsignal_chunk(self, block_index, seg_index,
290290 def _spike_count (self , block_index , seg_index , unit_index ):
291291 count = 0
292292 head_id = self .header ['unit_channels' ][unit_index ][1 ]
293- for mt in self .file .sects [block_index ].groups [seg_index ].multi_tags :
293+ for mt in self .file .blocks [block_index ].groups [seg_index ].multi_tags :
294294 for src in mt .sources :
295295 if mt .type == 'neo.spiketrain' and [src .type == "neo.unit" ]:
296296 if head_id == src .id :
@@ -338,7 +338,7 @@ def _get_spike_raw_waveforms(self, block_index, seg_index, unit_index,
338338
339339 def _event_count (self , block_index , seg_index , event_channel_index ):
340340 event_count = 0
341- segment = self .file .sects [block_index ].groups [seg_index ]
341+ segment = self .file .blocks [block_index ].groups [seg_index ]
342342 for event in segment .multi_tags :
343343 if event .type == 'neo.event' or event .type == 'neo.epoch' :
344344 if event_count == event_channel_index :
@@ -354,7 +354,7 @@ def _get_event_timestamps(self, block_index, seg_index,
354354 durations = None
355355 if event_channel_index is None :
356356 raise IndexError
357- for mt in self .file .sects [block_index ].groups [seg_index ].multi_tags :
357+ for mt in self .file .blocks [block_index ].groups [seg_index ].multi_tags :
358358 if mt .type == "neo.event" or mt .type == "neo.epoch" :
359359 labels .append (mt .positions .dimensions [0 ].labels )
360360 po = mt .positions
@@ -381,7 +381,7 @@ def _get_event_timestamps(self, block_index, seg_index,
381381
382382 def _rescale_event_timestamp (self , event_timestamps , dtype = 'float64' ):
383383 ev_unit = ''
384- for mt in self .file .sects [0 ].groups [0 ].multi_tags :
384+ for mt in self .file .blocks [0 ].groups [0 ].multi_tags :
385385 if mt .type == "neo.event" :
386386 ev_unit = mt .positions .unit
387387 break
@@ -393,7 +393,7 @@ def _rescale_event_timestamp(self, event_timestamps, dtype='float64'):
393393
394394 def _rescale_epoch_duration (self , raw_duration , dtype = 'float64' ):
395395 ep_unit = ''
396- for mt in self .file .sects [0 ].groups [0 ].multi_tags :
396+ for mt in self .file .blocks [0 ].groups [0 ].multi_tags :
397397 if mt .type == "neo.epoch" :
398398 ep_unit = mt .positions .unit
399399 break
0 commit comments