Skip to content

Commit c1cb3d2

Browse files
committed
Zach request
1 parent b7c4309 commit c1cb3d2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/spikeinterface/core/unitsaggregationsorting.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ def __init__(self, sorting_list, renamed_unit_ids=None):
3434
)
3535
unit_ids = list(renamed_unit_ids)
3636
else:
37-
all_ids_are_same_type = np.unique([sort.get_unit_ids().dtype for sort in sorting_list]).size == 1
37+
unit_ids_dtypes = [sort.get_unit_ids().dtype for sort in sorting_list]
38+
all_ids_are_same_type = np.unique(unit_ids_dtypes).size == 1
3839
all_units_ids_are_unique = False
3940
if all_ids_are_same_type:
4041
combined_ids = np.concatenate([sort.get_unit_ids() for sort in sorting_list])
@@ -44,7 +45,10 @@ def __init__(self, sorting_list, renamed_unit_ids=None):
4445
unit_ids = combined_ids
4546
else:
4647
default_unit_ids = [str(i) for i in range(num_all_units)]
47-
unit_ids = default_unit_ids
48+
if all_ids_are_same_type and np.issubdtype(unit_ids_dtypes[0], np.integer):
49+
unit_ids = np.arange(num_all_units, dtype=dtype)
50+
else:
51+
unit_ids = default_unit_ids
4852

4953
# unit map maps unit ids that are used to get spike trains
5054
u_id = 0

0 commit comments

Comments
 (0)