Skip to content

Commit

Permalink
use strings as ids in generators
Browse files Browse the repository at this point in the history
  • Loading branch information
h-mayorquin committed Dec 17, 2024
1 parent 6fde997 commit 0bf2b08
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/spikeinterface/core/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def generate_sorting(
seed = _ensure_seed(seed)
rng = np.random.default_rng(seed)
num_segments = len(durations)
unit_ids = np.arange(num_units)
unit_ids = [str(id) for id in np.arange(num_units)]

spikes = []
for segment_index in range(num_segments):
Expand Down Expand Up @@ -1111,7 +1111,7 @@ def __init__(
"""

unit_ids = np.arange(num_units)
unit_ids = [str(id) for id in np.arange(num_units)]
super().__init__(sampling_frequency, unit_ids)

self.num_units = num_units
Expand Down Expand Up @@ -1280,7 +1280,7 @@ def __init__(
noise_block_size: int = 30000,
):

channel_ids = np.arange(num_channels)
channel_ids = [str(id) for id in np.arange(num_channels)]
dtype = np.dtype(dtype).name # Cast to string for serialization
if dtype not in ("float32", "float64"):
raise ValueError(f"'dtype' must be 'float32' or 'float64' but is {dtype}")
Expand Down

0 comments on commit 0bf2b08

Please sign in to comment.