Skip to content

Commit

Permalink
Fix generation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alejoe91 committed Jul 12, 2024
1 parent 4c4e70f commit abb6a7c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/spikeinterface/generation/tests/test_hybrid_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
generate_templates,
generate_unit_locations,
)
from spikeinterface.preprocessing.motion import correct_motion, load_motion_info
from spikeinterface.preprocessing.motion import correct_motion
from spikeinterface.generation.hybrid_tools import (
estimate_templates_from_recording,
generate_hybrid_recording,
Expand Down Expand Up @@ -35,8 +35,10 @@ def test_generate_hybrid_with_sorting():


def test_generate_hybrid_motion():
rec, _ = generate_ground_truth_recording(sampling_frequency=20000, durations=[10], seed=0)
_, motion_info = correct_motion(rec, output_motion_info=True)
rec, _ = generate_ground_truth_recording(sampling_frequency=20000, durations=[10], num_channels=16, seed=0)
_, motion_info = correct_motion(
rec, output_motion_info=True, estimate_motion_kwargs={"win_step_um": 20, "win_scale_um": 20}
)
motion = motion_info["motion"]
hybrid, sorting_hybrid = generate_hybrid_recording(rec, motion=motion, seed=0)
assert rec.get_num_channels() == hybrid.get_num_channels()
Expand Down
4 changes: 2 additions & 2 deletions src/spikeinterface/sortingcomponents/motion/motion_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ def get_spatial_windows(

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

0 comments on commit abb6a7c

Please sign in to comment.