silence_periods() error when using mode='noise'

Open
#4,420 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
data

Research direction

Start at spikeinterface.preprocessing.silence_periods() and inspect the noise-mode path around the dtype validation shown in the traceback. Reproduce the failure with a recording whose dtype is int16 and mode='noise'; done when the intended noise mode handles this documented input or the required conversion is explicitly documented and tested.

Written by the indexing model from the issue text.

Description

Hi, I've been trying to use spikeinterface.preprocessing.silence_periods() which works fine when mode='zeros'. However, when I try mode='noise',

1287 dtype = np.dtype(dtype).name # Cast to string for serialization
1288 if dtype not in ("float32", "float64"):
-> 1289 raise ValueError(f"'dtype' must be 'float32' or 'float64' but is {dtype}")
1290 assert strategy in ("tile_pregenerated", "on_the_fly"), "'strategy' must be 'tile_pregenerated' or 'on_the_fly'"
1292 if np.isscalar(noise_levels):

ValueError: 'dtype' must be 'float32' or 'float64' but is int16

My rec.dtype returns int16 indeed. Do I need to do some conversion before I can use this? Thanks!

Dominant language
Python
Stars
847
Forks
280
Avg merge
3d 9h
Merged PRs (30d)
29

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SpikeInterface/spikeinterface

All issues in SpikeInterface/spikeinterface

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.