@@ -170,7 +170,7 @@ def allocate_waveforms_buffers(
170170 Dictionary to "construct" array in workers process (memmap file or sharemem)
171171 """
172172
173- nsamples = nbefore + nafter
173+ n_samples = nbefore + nafter
174174
175175 dtype = np .dtype (dtype )
176176 if mode == "shared_memory" :
@@ -187,11 +187,11 @@ def allocate_waveforms_buffers(
187187 num_chans = recording .get_num_channels ()
188188 else :
189189 num_chans = np .sum (sparsity_mask [unit_ind , :])
190- shape = (n_spikes , nsamples , num_chans )
190+ shape = (int ( n_spikes ), int ( n_samples ), int ( num_chans ) )
191191
192192 if mode == "memmap" :
193193 filename = str (folder / f"waveforms_{ unit_id } .npy" )
194- arr = np .lib .format .open_memmap (filename , mode = "w+" , dtype = dtype , shape = shape )
194+ arr = np .lib .format .open_memmap (filename , mode = "w+" , dtype = dtype . str , shape = shape )
195195 waveforms_by_units [unit_id ] = arr
196196 arrays_info [unit_id ] = filename
197197 elif mode == "shared_memory" :
@@ -476,7 +476,7 @@ def extract_waveforms_to_single_buffer(
476476 Optionally return in case of shared_memory if copy=False.
477477 Dictionary to "construct" array in workers process (memmap file or sharemem info)
478478 """
479- nsamples = nbefore + nafter
479+ n_samples = nbefore + nafter
480480
481481 dtype = np .dtype (dtype )
482482 if mode == "shared_memory" :
@@ -489,7 +489,7 @@ def extract_waveforms_to_single_buffer(
489489 num_chans = recording .get_num_channels ()
490490 else :
491491 num_chans = int (max (np .sum (sparsity_mask , axis = 1 ))) # This is a numpy scalar, so we cast to int
492- shape = (num_spikes , nsamples , num_chans )
492+ shape = (int ( num_spikes ), int ( n_samples ), int ( num_chans ) )
493493
494494 if mode == "memmap" :
495495 all_waveforms = np .lib .format .open_memmap (file_path , mode = "w+" , dtype = dtype , shape = shape )
0 commit comments