Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/spikeinterface/sortingcomponents/clustering/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def merge_clusters(
A vector of sample shift to be reverse applied on original sample_index on peak detection
Negative shift means too early.
Posituve shift means too late.
So the correction must be applied like this externaly:
So the correction must be applied like this externally:
final_peaks = peaks.copy()
final_peaks['sample_index'] -= peak_shifts

Expand Down Expand Up @@ -132,7 +132,7 @@ def merge_clusters(
peak_shifts = np.zeros(peak_labels.size, dtype="int64")
for merge, shifts in zip(merges, group_shifts):
label0 = merge[0]
mask = np.in1d(peak_labels, merge)
mask = np.isin(peak_labels, merge)
merge_peak_labels[mask] = label0
for l, label1 in enumerate(merge):
if l == 0:
Expand Down Expand Up @@ -265,7 +265,7 @@ def find_merge_pairs(
# progress_bar=True,
):
"""
Searh some possible merge 2 by 2.
Search some possible merge 2 by 2.
"""
job_kwargs = fix_job_kwargs(job_kwargs)

Expand Down Expand Up @@ -605,7 +605,7 @@ def merge(
class NormalizedTemplateDiff:
"""
Compute the normalized (some kind of) template differences.
And merge if below a threhold.
And merge if below a threshold.
Do this at several shift.

"""
Expand Down
8 changes: 4 additions & 4 deletions src/spikeinterface/sortingcomponents/clustering/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class FeaturesLoader:
"""
Feature can be computed in memory or in a folder contaning npy files.
Feature can be computed in memory or in a folder containing npy files.

This class read the folder and behave like a dict of array lazily.

Expand Down Expand Up @@ -52,7 +52,7 @@ def aggregate_sparse_features(peaks, peak_indices, sparse_feature, sparse_mask,
"""
Aggregate sparse features that have unaligned channels and realigned then on target_channels.

This is usefull to aligned back peaks waveform or pca or tsvd when detected a differents channels.
This is useful to aligned back peaks waveform or pca or tsvd when detected a differents channels.


Parameters
Expand Down Expand Up @@ -87,7 +87,7 @@ def aggregate_sparse_features(peaks, peak_indices, sparse_feature, sparse_mask,
peak_inds = np.flatnonzero(local_peaks["channel_index"] == chan)
if np.all(np.isin(target_channels, sparse_chans)):
# peaks feature channel have all target_channels
source_chans = np.flatnonzero(np.in1d(sparse_chans, target_channels))
source_chans = np.flatnonzero(np.isin(sparse_chans, target_channels))
aligned_features[peak_inds, :, :] = sparse_feature[peak_indices[peak_inds], :, :][:, :, source_chans]
else:
# some channel are missing, peak are not removde
Expand Down Expand Up @@ -149,7 +149,7 @@ def apply_waveforms_shift(waveforms, peak_shifts, inplace=False):
"""
Apply a shift a spike level to realign waveforms buffers.

This is usefull to compute template after merge when to cluster are shifted.
This is useful to compute template after merge when to cluster are shifted.

A negative shift need the waveforms to be moved toward the right because the trough was too early.
A positive shift need the waveforms to be moved toward the left because the trough was too late.
Expand Down