Skip to content

Commit

Permalink
Merge pull request #1995 from alejoe91/fix-1994
Browse files Browse the repository at this point in the history
Allow MergeUnitsSorting to handle tuples
  • Loading branch information
alejoe91 authored Sep 19, 2023
2 parents 17b0c03 + f013828 commit e5cf907
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/spikeinterface/curation/mergeunitssorting.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MergeUnitsSorting(BaseSorting):
----------
parent_sorting: Recording
The sorting object
units_to_merge: list of lists
units_to_merge: list/tuple of lists/tuples
A list of lists for every merge group. Each element needs to have at least two elements (two units to merge),
but it can also have more (merge multiple units at once).
new_unit_ids: None or list
Expand All @@ -24,6 +24,7 @@ class MergeUnitsSorting(BaseSorting):
Default: 'keep'
delta_time_ms: float or None
Number of ms to consider for duplicated spikes. None won't check for duplications
Returns
-------
sorting: Sorting
Expand All @@ -33,7 +34,7 @@ class MergeUnitsSorting(BaseSorting):
def __init__(self, parent_sorting, units_to_merge, new_unit_ids=None, properties_policy="keep", delta_time_ms=0.4):
self._parent_sorting = parent_sorting

if not isinstance(units_to_merge[0], list):
if not isinstance(units_to_merge[0], (list, tuple)):
# keep backward compatibility : the previous behavior was only one merge
units_to_merge = [units_to_merge]

Expand Down

0 comments on commit e5cf907

Please sign in to comment.