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 Jul 7, 2024
1 parent 1878fa4 commit 8a25138
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/spikeinterface/core/analyzer_extension_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,10 @@ def _merge_extension_data(
):
new_data = dict()


waveforms = self.data["waveforms"]
some_spikes = self.sorting_analyzer.get_extension("random_spikes").get_random_spikes()

if keep_mask is not None:
if keep_mask is not None:
spike_indices = self.sorting_analyzer.get_extension("random_spikes").get_data()
valid = keep_mask[spike_indices]
some_spikes = some_spikes[valid]
Expand Down
7 changes: 3 additions & 4 deletions src/spikeinterface/postprocessing/principal_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,9 @@ def _merge_extension_data(
new_data["pca_projection"] = pca_projections.copy()
for to_be_merge, unit_id in zip(units_to_merge, new_unit_ids):
new_channel_ids = sparsity.unit_id_to_channel_ids[unit_id]
new_projections, spike_indices = self.get_some_projections(new_channel_ids,
to_be_merge,
kept_projections=new_data["pca_projection"],
kept_spikes=some_spikes)
new_projections, spike_indices = self.get_some_projections(
new_channel_ids, to_be_merge, kept_projections=new_data["pca_projection"], kept_spikes=some_spikes
)
num_chans = new_projections.shape[2]
new_data["pca_projection"][spike_indices, :, :num_chans] = new_projections
new_data["pca_projection"][spike_indices, :, num_chans:] = 0
Expand Down

0 comments on commit 8a25138

Please sign in to comment.