Skip to content

Commit

Permalink
Merge pull request #3445 from alejoe91/relax-causal-filter-tests
Browse files Browse the repository at this point in the history
Relax causal filter tests
  • Loading branch information
alejoe91 authored Sep 26, 2024
2 parents cc8735c + f7efefe commit 0e91414
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/spikeinterface/preprocessing/tests/test_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def test_causal_filter_main_kwargs(self, recording_and_data):

filt_data = causal_filter(recording, direction="forward", **options, margin_ms=0).get_traces()

assert np.allclose(test_data, filt_data, rtol=0, atol=1e-6)
assert np.allclose(test_data, filt_data, rtol=0, atol=1e-4)

# Then, change all kwargs to ensure they are propagated
# and check the backwards version.
Expand All @@ -66,7 +66,7 @@ def test_causal_filter_main_kwargs(self, recording_and_data):

filt_data = causal_filter(recording, direction="backward", **options, margin_ms=0).get_traces()

assert np.allclose(test_data, filt_data, rtol=0, atol=1e-6)
assert np.allclose(test_data, filt_data, rtol=0, atol=1e-4)

def test_causal_filter_custom_coeff(self, recording_and_data):
"""
Expand All @@ -89,7 +89,7 @@ def test_causal_filter_custom_coeff(self, recording_and_data):

filt_data = causal_filter(recording, direction="forward", **options, margin_ms=0).get_traces()

assert np.allclose(test_data, filt_data, rtol=0, atol=1e-6, equal_nan=True)
assert np.allclose(test_data, filt_data, rtol=0, atol=1e-4, equal_nan=True)

# Next, in "sos" mode
options["filter_mode"] = "sos"
Expand All @@ -100,7 +100,7 @@ def test_causal_filter_custom_coeff(self, recording_and_data):

filt_data = causal_filter(recording, direction="forward", **options, margin_ms=0).get_traces()

assert np.allclose(test_data, filt_data, rtol=0, atol=1e-6, equal_nan=True)
assert np.allclose(test_data, filt_data, rtol=0, atol=1e-4, equal_nan=True)

def test_causal_kwarg_error_raised(self, recording_and_data):
"""
Expand Down

0 comments on commit 0e91414

Please sign in to comment.