Skip to content

Commit

Permalink
Catching cases with no units to merge
Browse files Browse the repository at this point in the history
  • Loading branch information
yger committed Jul 1, 2024
1 parent 14d2002 commit a3cc09b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/spikeinterface/core/sortinganalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,9 @@ def merge_units(

assert merging_mode in ["soft", "hard"], "Merging mode should be either soft or hard"

if len(units_to_merge) == 0:
return self

new_unit_ids = get_new_unit_ids_for_merges(self.sorting, units_to_merge, new_unit_ids)

if not isinstance(units_to_merge[0], (list, tuple)):
Expand Down

0 comments on commit a3cc09b

Please sign in to comment.