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 Sep 15, 2023
1 parent 646455a commit 4410d6e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/spikeinterface/postprocessing/amplitude_scalings.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,9 @@ def _amplitude_scalings_chunk(segment_index, start_frame, end_frame, worker_ctx)
# set colliding spikes apart (if needed)
if handle_collisions:
# local spikes with margin!
i0_margin, i1_margin = np.searchsorted(spikes_in_segment["sample_index"], [start_frame - left, end_frame + right])
i0_margin, i1_margin = np.searchsorted(
spikes_in_segment["sample_index"], [start_frame - left, end_frame + right]
)
local_spikes_w_margin = spikes_in_segment[i0_margin:i1_margin]
collisions_local = find_collisions(
local_spikes, local_spikes_w_margin, delta_collision_samples, unit_inds_to_channel_indices
Expand Down Expand Up @@ -461,7 +463,7 @@ def find_collisions(spikes, spikes_w_margin, delta_collision_samples, unit_inds_
# find the possible spikes per and post within delta_collision_samples
consecutive_window_pre, consecutive_window_post = np.searchsorted(
spikes_w_margin["sample_index"],
[spike["sample_index"] - delta_collision_samples, spike["sample_index"] + delta_collision_samples]
[spike["sample_index"] - delta_collision_samples, spike["sample_index"] + delta_collision_samples],
)

# exclude the spike itself (it is included in the collision_spikes by construction)
Expand Down

0 comments on commit 4410d6e

Please sign in to comment.