Skip to content

Commit a0de32c

Browse files
committed
add test
1 parent 48d816b commit a0de32c

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/spikeinterface/core/tests/test_channelsaggregationrecording.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,19 @@ def test_channel_aggregation_does_not_preserve_ids_not_the_same_type():
118118
assert list(aggregated_recording.get_channel_ids()) == ["0", "1", "2", "3", "4"]
119119

120120

121+
def test_channel_aggregation_with_string_dtypes_of_different_size():
122+
recording1 = generate_recording(num_channels=2, durations=[10], set_probe=False)
123+
recording1 = recording1.rename_channels(new_channel_ids=np.array(["8", "9"], dtype="<U1"))
124+
125+
recording2 = generate_recording(num_channels=2, durations=[10], set_probe=False)
126+
recording2 = recording2.rename_channels(new_channel_ids=np.array(["10", "11"], dtype="<U2"))
127+
128+
aggregated_recording = aggregate_channels([recording1, recording2])
129+
assert aggregated_recording.get_num_channels() == 4
130+
aggregated_recording_channel_ids = list(aggregated_recording.get_channel_ids())
131+
assert aggregated_recording_channel_ids == ["8", "9", "10", "11"]
132+
assert aggregated_recording.channel_ids.dtype == np.dtype("<U2")
133+
134+
121135
if __name__ == "__main__":
122136
test_channelsaggregationrecording()

0 commit comments

Comments
 (0)