Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

silence_periods with mode 'noise' is incompatible with get_noise_levels #3554

Closed
maxjuv opened this issue Nov 27, 2024 · 2 comments · Fixed by #3557
Closed

silence_periods with mode 'noise' is incompatible with get_noise_levels #3554

maxjuv opened this issue Nov 27, 2024 · 2 comments · Fixed by #3557
Labels
preprocessing Related to preprocessing module

Comments

@maxjuv
Copy link
Contributor

maxjuv commented Nov 27, 2024

Hello,
I recently added in my preprocessing silence_periods(mode='noise'). Since then I was not able to estimate noise level. I got the following error :

  File "/home/users/j/juventin/local_python_package/spikeinterface/src/spikeinterface/preprocessing/silence_periods.py", line 76, in __init__
    noise_levels = get_noise_levels(
  File "/home/users/j/juventin/local_python_package/spikeinterface/src/spikeinterface/core/recording_tools.py", line 789, in get_noise_levels
    recording_slices = get_random_recording_slices(recording, **random_slices_kwargs)
TypeError: get_random_recording_slices() got an unexpected keyword argument 'noise_generator'

I tracked the error. It happened that during the silence_period preprocessing, 'noise_generator' is added in the recording kwargs

self._kwargs = dict(recording=recording, list_periods=list_periods, mode=mode, noise_generator=noise_generator)

Then, when estimating the noise levels (get_noise_levels), spikeinterface passes the variables 'noise_generator' in random_slices_kwargs, which is not recognized.
Is it really useful to put 'noise_generator' in the kwargs ?
In my script I solved it by removing 'noise_generator' from the kwargs.

@zm711
Copy link
Collaborator

zm711 commented Nov 27, 2024

I think this is likely @samuelgarcia , but maybe @alejoe91 knows this?

@yger
Copy link
Collaborator

yger commented Nov 29, 2024

I've made a putative patch in #3557

@alejoe91 alejoe91 added the preprocessing Related to preprocessing module label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preprocessing Related to preprocessing module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants