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 29, 2024
1 parent c3e2115 commit f609b23
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/spikeinterface/curation/auto_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,16 +357,16 @@ def get_pairs_via_nntree(sorting_analyzer, k_nn=5, pair_mask=None):

for unit_ind in range(n):
mask = spikes["unit_index"] == unit_ind
valid = pair_mask[unit_ind, unit_ind+1:]
valid_indices = np.arange(unit_ind+1, n)[valid]
valid = pair_mask[unit_ind, unit_ind + 1 :]
valid_indices = np.arange(unit_ind + 1, n)[valid]
if len(valid_indices) > 0:
ind = kdtree.kneighbors(data[mask], return_distance=False)
ind = ind.flatten()
mask_2 = np.isin(spikes["unit_index"][ind], valid_indices)
ind = ind[mask_2]
chan_inds, all_counts = np.unique(spikes["unit_index"][ind], return_counts=True)
all_counts = all_counts.astype(float)
#all_counts /= all_spike_counts[chan_inds]
# all_counts /= all_spike_counts[chan_inds]
best_indices = np.argsort(all_counts)[::-1][0:]
pair_mask[unit_ind] &= np.isin(np.arange(n), chan_inds[best_indices])
return pair_mask
Expand Down

0 comments on commit f609b23

Please sign in to comment.