Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 21, 2024
1 parent abb9177 commit 6abb74b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/spikeinterface/core/sorting_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def spike_vector_to_spike_trains(spike_vector: list[np.array], unit_ids: np.arra
return spike_trains


def spike_vector_to_indices(spike_vector: list[np.array], unit_ids: np.array, absolute_index : bool = False):
def spike_vector_to_indices(spike_vector: list[np.array], unit_ids: np.array, absolute_index: bool = False):
"""
Similar to spike_vector_to_spike_trains but instead having the spike_trains (aka spike times) return
spike indices by segment and units.
Expand All @@ -66,7 +66,7 @@ def spike_vector_to_indices(spike_vector: list[np.array], unit_ids: np.array, ab
or relative to segment usefull with a list of spike vectors
When a unique spike vectors (or amplitudes) is used then absolute_index should be True.
When a list of spikes (or amplitudes) is used then absolute_index should be False.
Returns
-------
spike_indices: dict[dict]:
Expand All @@ -88,7 +88,7 @@ def spike_vector_to_indices(spike_vector: list[np.array], unit_ids: np.array, ab

num_units = unit_ids.size
spike_indices = {}

total_spikes = 0
for segment_index, spikes in enumerate(spike_vector):
indices = np.arange(spikes.size, dtype=np.int64)
Expand All @@ -100,7 +100,6 @@ def spike_vector_to_indices(spike_vector: list[np.array], unit_ids: np.array, ab

spike_indices[segment_index] = dict(zip(unit_ids, list_of_spike_indices))


return spike_indices


Expand Down

0 comments on commit 6abb74b

Please sign in to comment.