6363 _spike_channel_dtype ,
6464 _event_channel_dtype ,
6565)
66- from .utils import get_memmap_shape , get_memmap_chunk_from_open_file
66+ from .utils import get_memmap_shape
6767
6868
6969class SpikeGLXRawIO (BaseRawIO ):
@@ -127,7 +127,7 @@ def _parse_header(self):
127127 nb_segment = np .unique ([info ["seg_index" ] for info in self .signals_info_list ]).size
128128
129129
130- self ._memmaps = {}
130+ # self._memmaps = {}
131131 self .signals_info_dict = {}
132132 # on block
133133 self ._buffer_descriptions = {0 :{}}
@@ -139,11 +139,11 @@ def _parse_header(self):
139139 self .signals_info_dict [key ] = info
140140
141141 # create memmap
142- data = np .memmap (info ["bin_file" ], dtype = "int16" , mode = "r" , offset = 0 , order = "C" )
142+ # data = np.memmap(info["bin_file"], dtype="int16", mode="r", offset=0, order="C")
143143 # this should be (info['sample_length'], info['num_chan'])
144144 # be some file are shorten
145- data = data .reshape (- 1 , info ["num_chan" ])
146- self ._memmaps [key ] = data
145+ # data = data.reshape(-1, info["num_chan"])
146+ # self._memmaps[key] = data
147147
148148 stream_index = stream_names .index (info ["stream_name" ])
149149 if seg_index not in self ._buffer_descriptions [0 ]:
@@ -273,42 +273,42 @@ def _segment_t_start(self, block_index, seg_index):
273273 def _segment_t_stop (self , block_index , seg_index ):
274274 return self ._t_stops [seg_index ]
275275
276- def _get_signal_size (self , block_index , seg_index , stream_index ):
277- stream_id = self .header ["signal_streams" ][stream_index ]["id" ]
278- memmap = self ._memmaps [seg_index , stream_id ]
279- return int (memmap .shape [0 ])
276+ # def _get_signal_size(self, block_index, seg_index, stream_index):
277+ # stream_id = self.header["signal_streams"][stream_index]["id"]
278+ # memmap = self._memmaps[seg_index, stream_id]
279+ # return int(memmap.shape[0])
280280
281281 def _get_signal_t_start (self , block_index , seg_index , stream_index ):
282282 return 0.0
283283
284- def _get_analogsignal_chunk (self , block_index , seg_index , i_start , i_stop , stream_index , channel_indexes ):
285- stream_id = self .header ["signal_streams" ][stream_index ]["id" ]
286- memmap = self ._memmaps [seg_index , stream_id ]
287- stream_name = self .header ["signal_streams" ]["name" ][stream_index ]
288-
289- # take care of sync channel
290- info = self .signals_info_dict [0 , stream_name ]
291- if not self .load_sync_channel and info ["has_sync_trace" ]:
292- memmap = memmap [:, :- 1 ]
293-
294- # since we cut the memmap, we can simplify the channel selection
295- if channel_indexes is None :
296- channel_selection = slice (None )
297- elif isinstance (channel_indexes , slice ):
298- channel_selection = channel_indexes
299- elif not isinstance (channel_indexes , slice ):
300- if np .all (np .diff (channel_indexes ) == 1 ):
301- # consecutive channel then slice this avoid a copy (because of ndarray.take(...)
302- # and so keep the underlying memmap
303- channel_selection = slice (channel_indexes [0 ], channel_indexes [0 ] + len (channel_indexes ))
304- else :
305- channel_selection = channel_indexes
306- else :
307- raise ValueError ("get_analogsignal_chunk : channel_indexes" "must be slice or list or array of int" )
308-
309- raw_signals = memmap [slice (i_start , i_stop ), channel_selection ]
310-
311- return raw_signals
284+ # def _get_analogsignal_chunk(self, block_index, seg_index, i_start, i_stop, stream_index, channel_indexes):
285+ # stream_id = self.header["signal_streams"][stream_index]["id"]
286+ # memmap = self._memmaps[seg_index, stream_id]
287+ # stream_name = self.header["signal_streams"]["name"][stream_index]
288+
289+ # # take care of sync channel
290+ # info = self.signals_info_dict[0, stream_name]
291+ # if not self.load_sync_channel and info["has_sync_trace"]:
292+ # memmap = memmap[:, :-1]
293+
294+ # # since we cut the memmap, we can simplify the channel selection
295+ # if channel_indexes is None:
296+ # channel_selection = slice(None)
297+ # elif isinstance(channel_indexes, slice):
298+ # channel_selection = channel_indexes
299+ # elif not isinstance(channel_indexes, slice):
300+ # if np.all(np.diff(channel_indexes) == 1):
301+ # # consecutive channel then slice this avoid a copy (because of ndarray.take(...)
302+ # # and so keep the underlying memmap
303+ # channel_selection = slice(channel_indexes[0], channel_indexes[0] + len(channel_indexes))
304+ # else:
305+ # channel_selection = channel_indexes
306+ # else:
307+ # raise ValueError("get_analogsignal_chunk : channel_indexes" "must be slice or list or array of int")
308+
309+ # raw_signals = memmap[slice(i_start, i_stop), channel_selection]
310+
311+ # return raw_signals
312312
313313 def _event_count (self , event_channel_idx , block_index = None , seg_index = None ):
314314 timestamps , _ , _ = self ._get_event_timestamps (block_index , seg_index , event_channel_idx , None , None )
0 commit comments