From b63221ed1419dcdf08ee66c724a1d2815acce246 Mon Sep 17 00:00:00 2001 From: Yue Huang <806628409@qq.com> Date: Thu, 19 Sep 2024 02:07:02 +0800 Subject: [PATCH 1/3] Update job_tools.py --- src/spikeinterface/core/job_tools.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/spikeinterface/core/job_tools.py b/src/spikeinterface/core/job_tools.py index a5279247f5..55870cd688 100644 --- a/src/spikeinterface/core/job_tools.py +++ b/src/spikeinterface/core/job_tools.py @@ -136,11 +136,8 @@ def divide_segment_into_chunks(num_frames, chunk_size): else: n = num_frames // chunk_size - frame_starts = np.arange(n) * chunk_size - frame_stops = frame_starts + chunk_size - - frame_starts = frame_starts.tolist() - frame_stops = frame_stops.tolist() + frame_starts = [i * chunk_size for i in range(n)] + frame_stops = [(i+1) * chunk_size for i in range(n)] if (num_frames % chunk_size) > 0: frame_starts.append(n * chunk_size) From 0781a39082639b87c0239d709a06000f38fdd1ba Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2024 18:16:37 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/spikeinterface/core/job_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spikeinterface/core/job_tools.py b/src/spikeinterface/core/job_tools.py index 55870cd688..3cd7313b76 100644 --- a/src/spikeinterface/core/job_tools.py +++ b/src/spikeinterface/core/job_tools.py @@ -137,7 +137,7 @@ def divide_segment_into_chunks(num_frames, chunk_size): n = num_frames // chunk_size frame_starts = [i * chunk_size for i in range(n)] - frame_stops = [(i+1) * chunk_size for i in range(n)] + frame_stops = [(i + 1) * chunk_size for i in range(n)] if (num_frames % chunk_size) > 0: frame_starts.append(n * chunk_size) From 41f4c311398cb909207535e3fcf2a373c850dafd Mon Sep 17 00:00:00 2001 From: Yue Huang <806628409@qq.com> Date: Thu, 19 Sep 2024 04:35:21 +0800 Subject: [PATCH 3/3] Update job_tools.py --- src/spikeinterface/core/job_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spikeinterface/core/job_tools.py b/src/spikeinterface/core/job_tools.py index 3cd7313b76..5240edcee7 100644 --- a/src/spikeinterface/core/job_tools.py +++ b/src/spikeinterface/core/job_tools.py @@ -137,7 +137,7 @@ def divide_segment_into_chunks(num_frames, chunk_size): n = num_frames // chunk_size frame_starts = [i * chunk_size for i in range(n)] - frame_stops = [(i + 1) * chunk_size for i in range(n)] + frame_stops = [frame_start + chunk_size for frame_start in frame_starts] if (num_frames % chunk_size) > 0: frame_starts.append(n * chunk_size)