diff --git a/doc/releases/0.100.6.rst b/doc/releases/0.100.6.rst index 99f34f534f..7f2bb5cd66 100644 --- a/doc/releases/0.100.6.rst +++ b/doc/releases/0.100.6.rst @@ -7,6 +7,7 @@ SpikeInterface 0.100.6 release notes Minor release with bug fixes +* Avoid np.prod in make_shared_array (#2621) * Improve caching of MS5 sorter (#2690) * Allow for remove_excess_spikes to remove negative spike times (#2716) * Update ks4 wrapper for newer version>=4.0.3 (#2701, #2774) diff --git a/doc/whatisnew.rst b/doc/whatisnew.rst index 48f566087f..2ba199eb94 100644 --- a/doc/whatisnew.rst +++ b/doc/whatisnew.rst @@ -40,11 +40,18 @@ Release notes releases/0.9.1.rst +Version 0.100.6 +=============== + +* Minor release with bug fixes + + Version 0.100.5 =============== * Minor release with bug fixes + Version 0.100.4 =============== diff --git a/src/spikeinterface/core/core_tools.py b/src/spikeinterface/core/core_tools.py index 3b82436d5c..3725fcfba8 100644 --- a/src/spikeinterface/core/core_tools.py +++ b/src/spikeinterface/core/core_tools.py @@ -7,6 +7,7 @@ import json from copy import deepcopy +from math import prod import numpy as np from tqdm import tqdm @@ -163,7 +164,8 @@ def make_shared_array(shape, dtype): from multiprocessing.shared_memory import SharedMemory dtype = np.dtype(dtype) - nbytes = int(np.prod(shape) * dtype.itemsize) + shape = tuple(int(x) for x in shape) # We need to be sure that shape comes in int instead of numpy scalars + nbytes = prod(shape) * dtype.itemsize shm = SharedMemory(name=None, create=True, size=nbytes) arr = np.ndarray(shape=shape, dtype=dtype, buffer=shm.buf) arr[:] = 0 diff --git a/src/spikeinterface/core/waveform_tools.py b/src/spikeinterface/core/waveform_tools.py index f9e39382df..8864ae0d39 100644 --- a/src/spikeinterface/core/waveform_tools.py +++ b/src/spikeinterface/core/waveform_tools.py @@ -483,7 +483,7 @@ def extract_waveforms_to_single_buffer( if sparsity_mask is None: num_chans = recording.get_num_channels() else: - num_chans = max(np.sum(sparsity_mask, axis=1)) + num_chans = int(max(np.sum(sparsity_mask, axis=1))) # This is a numpy scalar, so we cast to int shape = (num_spikes, nsamples, num_chans) if mode == "memmap":