From b0e7b1c60086fd818759b8df0f617d5441f4ff40 Mon Sep 17 00:00:00 2001 From: Pierre Yger Date: Fri, 29 Nov 2024 06:04:48 +0100 Subject: [PATCH 1/4] Fix kwargs in silence periods --- src/spikeinterface/preprocessing/silence_periods.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/spikeinterface/preprocessing/silence_periods.py b/src/spikeinterface/preprocessing/silence_periods.py index 85169011d8..a188f5d8db 100644 --- a/src/spikeinterface/preprocessing/silence_periods.py +++ b/src/spikeinterface/preprocessing/silence_periods.py @@ -97,7 +97,12 @@ def __init__(self, recording, list_periods, mode="zeros", noise_levels=None, see rec_segment = SilencedPeriodsRecordingSegment(parent_segment, periods, mode, noise_generator, seg_index) self.add_recording_segment(rec_segment) - self._kwargs = dict(recording=recording, list_periods=list_periods, mode=mode, noise_generator=noise_generator) + self._kwargs = dict(recording=recording, + list_periods=list_periods, + mode=mode, + noise_levels=noise_levels, + seed=seed, + random_chunk_kwargs=random_chunk_kwargs) class SilencedPeriodsRecordingSegment(BasePreprocessorSegment): From 60d7ad53b59fac5b47bd976905d64efc62b3daeb Mon Sep 17 00:00:00 2001 From: Pierre Yger Date: Fri, 29 Nov 2024 06:10:02 +0100 Subject: [PATCH 2/4] Fix --- src/spikeinterface/preprocessing/silence_periods.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/spikeinterface/preprocessing/silence_periods.py b/src/spikeinterface/preprocessing/silence_periods.py index a188f5d8db..5e410d51d5 100644 --- a/src/spikeinterface/preprocessing/silence_periods.py +++ b/src/spikeinterface/preprocessing/silence_periods.py @@ -100,7 +100,6 @@ def __init__(self, recording, list_periods, mode="zeros", noise_levels=None, see self._kwargs = dict(recording=recording, list_periods=list_periods, mode=mode, - noise_levels=noise_levels, seed=seed, random_chunk_kwargs=random_chunk_kwargs) From 01ae85cbb3ebcfd6f9e20eb191d92a278bbcb5e4 Mon Sep 17 00:00:00 2001 From: Pierre Yger Date: Fri, 29 Nov 2024 06:14:16 +0100 Subject: [PATCH 3/4] WIP --- src/spikeinterface/preprocessing/silence_periods.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spikeinterface/preprocessing/silence_periods.py b/src/spikeinterface/preprocessing/silence_periods.py index 5e410d51d5..7c518d02a0 100644 --- a/src/spikeinterface/preprocessing/silence_periods.py +++ b/src/spikeinterface/preprocessing/silence_periods.py @@ -100,8 +100,8 @@ def __init__(self, recording, list_periods, mode="zeros", noise_levels=None, see self._kwargs = dict(recording=recording, list_periods=list_periods, mode=mode, - seed=seed, - random_chunk_kwargs=random_chunk_kwargs) + seed=seed) + self._kwargs.update(random_chunk_kwargs) class SilencedPeriodsRecordingSegment(BasePreprocessorSegment): From db2b4d5130a095500637c06f9d74aa2f03d41b73 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 29 Nov 2024 05:15:54 +0000 Subject: [PATCH 4/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/spikeinterface/preprocessing/silence_periods.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/spikeinterface/preprocessing/silence_periods.py b/src/spikeinterface/preprocessing/silence_periods.py index 7c518d02a0..00d9a1a407 100644 --- a/src/spikeinterface/preprocessing/silence_periods.py +++ b/src/spikeinterface/preprocessing/silence_periods.py @@ -97,10 +97,7 @@ def __init__(self, recording, list_periods, mode="zeros", noise_levels=None, see rec_segment = SilencedPeriodsRecordingSegment(parent_segment, periods, mode, noise_generator, seg_index) self.add_recording_segment(rec_segment) - self._kwargs = dict(recording=recording, - list_periods=list_periods, - mode=mode, - seed=seed) + self._kwargs = dict(recording=recording, list_periods=list_periods, mode=mode, seed=seed) self._kwargs.update(random_chunk_kwargs)