Skip to content

Commit abb6a7c

Browse files
committed
Fix generation tests
1 parent 4c4e70f commit abb6a7c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/spikeinterface/generation/tests/test_hybrid_tools.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
generate_templates,
88
generate_unit_locations,
99
)
10-
from spikeinterface.preprocessing.motion import correct_motion, load_motion_info
10+
from spikeinterface.preprocessing.motion import correct_motion
1111
from spikeinterface.generation.hybrid_tools import (
1212
estimate_templates_from_recording,
1313
generate_hybrid_recording,
@@ -35,8 +35,10 @@ def test_generate_hybrid_with_sorting():
3535

3636

3737
def test_generate_hybrid_motion():
38-
rec, _ = generate_ground_truth_recording(sampling_frequency=20000, durations=[10], seed=0)
39-
_, motion_info = correct_motion(rec, output_motion_info=True)
38+
rec, _ = generate_ground_truth_recording(sampling_frequency=20000, durations=[10], num_channels=16, seed=0)
39+
_, motion_info = correct_motion(
40+
rec, output_motion_info=True, estimate_motion_kwargs={"win_step_um": 20, "win_scale_um": 20}
41+
)
4042
motion = motion_info["motion"]
4143
hybrid, sorting_hybrid = generate_hybrid_recording(rec, motion=motion, seed=0)
4244
assert rec.get_num_channels() == hybrid.get_num_channels()

src/spikeinterface/sortingcomponents/motion/motion_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,8 @@ def get_spatial_windows(
309309

310310
if num_windows < 1:
311311
raise Exception(
312-
f"get_spatial_windows(): win_step_um/win_scale_um/win_margin_um are too large for the probe size. "
313-
"You can try to reduce them or use rigid motion."
312+
f"get_spatial_windows(): {win_step_um=}/{win_scale_um=}/{win_margin_um=} are too large for the "
313+
f"probe size (depth range={np.ptp(contact_depths)}). You can try to reduce them or use rigid motion."
314314
)
315315
border = ((max_ - min_) % win_step_um) / 2
316316
window_centers = np.arange(num_windows + 1) * win_step_um + min_ + border

0 commit comments

Comments
 (0)