From 7ff0d12f552ceafa4fee0c793a449b6bf4b3ab51 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 09:52:24 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/spikeinterface/sorters/internal/spyking_circus2.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/spikeinterface/sorters/internal/spyking_circus2.py b/src/spikeinterface/sorters/internal/spyking_circus2.py index 339ab66378..e0b6515782 100644 --- a/src/spikeinterface/sorters/internal/spyking_circus2.py +++ b/src/spikeinterface/sorters/internal/spyking_circus2.py @@ -53,7 +53,7 @@ class Spykingcircus2Sorter(ComponentsBasedSorter): "cache_preprocessing": {"mode": "memory", "memory_limit": 0.5, "delete_cache": True}, "multi_units_only": False, "job_kwargs": {"n_jobs": 0.8}, - "seed" : 42, + "seed": 42, "debug": False, } @@ -393,17 +393,18 @@ def create_sorting_analyzer_with_templates(sorting, recording, templates, remove def divide_recording(recording, seed=None, **job_kwargs): from spikeinterface.core.job_tools import ensure_chunk_size from spikeinterface.core.job_tools import divide_segment_into_chunks + chunk_size = ensure_chunk_size(recording, **job_kwargs) recording_slices = [] for segment_index in range(recording.get_num_segments()): num_frames = recording.get_num_samples(segment_index) chunks = divide_segment_into_chunks(num_frames, chunk_size) recording_slices.extend([(segment_index, frame_start, frame_stop) for frame_start, frame_stop in chunks]) - + if seed is not None: rng = np.random.RandomState(seed) recording_slices = rng.permutation(recording_slices) - + return recording_slices