From 815f114c6d51f1c95db7d705c92fd635becf63f0 Mon Sep 17 00:00:00 2001 From: zm711 <92116279+zm711@users.noreply.github.com> Date: Thu, 14 Dec 2023 09:14:34 -0500 Subject: [PATCH] fix shuffle --- src/spikeinterface/core/generate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/spikeinterface/core/generate.py b/src/spikeinterface/core/generate.py index 3baff5aa9c..3e56467ca3 100644 --- a/src/spikeinterface/core/generate.py +++ b/src/spikeinterface/core/generate.py @@ -359,8 +359,9 @@ def synthesize_random_firings( a = refractory_sample b = refractory_sample * 20 shift = a + (b - a) * x**2 + shift = shift.astype("int64") spike_times[some] += shift - times0 = times0[(0 <= times0) & (times0 < segment_size)] + spike_times = spike_times[(0 <= spike_times) & (spike_times < segment_size)] (violations,) = np.nonzero(np.diff(spike_times) < refractory_sample) spike_times = np.delete(spike_times, violations)