Skip to content

Commit

Permalink
Fix analyzer sampling frequency check
Browse files Browse the repository at this point in the history
Because of floating errors, the smapling frequency can be slightly different between recording and sorting

e.g. 30000.305042016807 and 30000.31

This fixes that issue (same code that was used in the waveform extractor)
  • Loading branch information
DradeAW authored Mar 20, 2024
1 parent 52617ee commit 2f4acd3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/spikeinterface/core/sortinganalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def create(
sparsity=None,
):
# some checks
assert sorting.sampling_frequency == recording.sampling_frequency
assert math.isclose(sorting.sampling_frequency, recording.sampling_frequency, abs_tol=1e-2, rel_tol=1e-5):
# check that multiple probes are non-overlapping
all_probes = recording.get_probegroup().probes
check_probe_do_not_overlap(all_probes)
Expand Down

0 comments on commit 2f4acd3

Please sign in to comment.