Skip to content

Commit 73edb81

Browse files
committed
Tidying up tests.
1 parent 34ba6bc commit 73edb81

File tree

3 files changed

+169
-246
lines changed

3 files changed

+169
-246
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ test = [
148148
"pytest",
149149
"pytest-dependency",
150150
"pytest-cov",
151+
"pytest-mock",
151152

152153
"huggingface_hub",
153154

src/spikeinterface/preprocessing/inter_session_alignment/alignment_utils.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
from spikeinterface import BaseRecording
44
import numpy as np
55

6-
from spikeinterface.preprocessing import center
76
from spikeinterface.sortingcomponents.motion.motion_utils import make_2d_motion_histogram
8-
from scipy.optimize import minimize
97
from scipy.ndimage import gaussian_filter
108
from spikeinterface.sortingcomponents.motion.iterative_template import kriging_kernel
119
from packaging.version import Version
@@ -83,7 +81,7 @@ def get_2d_activity_histogram(
8381
activity_histogram *= scaler
8482

8583
if log_scale:
86-
activity_histogram = np.log10(1 + activity_histogram) # TODO: make_2d_motion_histogram uses log2
84+
activity_histogram = np.log2(1 + activity_histogram) # TODO: make_2d_motion_histogram uses log2
8785

8886
temporal_bin_centers = get_bin_centers(temporal_bin_edges)
8987
spatial_bin_centers = get_bin_centers(spatial_bin_edges)
@@ -318,11 +316,11 @@ def compute_histogram_crosscorrelation(
318316

319317
# Smooth the cross-correlations across the bins
320318
if smoothing_sigma_bin:
321-
xcorr_matrix = gaussian_filter(xcorr_matrix, smoothing_sigma_bin, axes=1)
319+
xcorr_matrix = gaussian_filter(xcorr_matrix, sigma=smoothing_sigma_bin, axes=1)
322320

323321
# Smooth the cross-correlations across the windows
324322
if num_windows > 1 and smoothing_sigma_window:
325-
xcorr_matrix = gaussian_filter(xcorr_matrix, smoothing_sigma_window, axes=0)
323+
xcorr_matrix = gaussian_filter(xcorr_matrix, sigma=smoothing_sigma_window, axes=0)
326324

327325
# Upsample the cross-correlation
328326
if interpolate:
@@ -333,9 +331,9 @@ def compute_histogram_crosscorrelation(
333331
K = kriging_kernel(
334332
np.c_[np.ones_like(shifts_array), shifts_array],
335333
np.c_[np.ones_like(shifts_upsampled), shifts_upsampled],
336-
kriging_sigma,
337-
kriging_p,
338-
kriging_d,
334+
sigma=kriging_sigma,
335+
p=kriging_p,
336+
d=kriging_d,
339337
)
340338

341339
xcorr_matrix = np.matmul(xcorr_matrix, K, axes=[(-2, -1), (-2, -1), (-2, -1)])

0 commit comments

Comments
 (0)