From bbe0c239249c0835b854de548b6da154e25bf044 Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Mon, 29 Apr 2024 16:37:42 +0200 Subject: [PATCH] Fix codecov tests --- src/spikeinterface/core/analyzer_extension_core.py | 4 +++- .../sortingcomponents/tests/test_waveforms/conftest.py | 6 +++--- src/spikeinterface/widgets/unit_waveforms.py | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/spikeinterface/core/analyzer_extension_core.py b/src/spikeinterface/core/analyzer_extension_core.py index eb3f568939..8ac22ac304 100644 --- a/src/spikeinterface/core/analyzer_extension_core.py +++ b/src/spikeinterface/core/analyzer_extension_core.py @@ -285,7 +285,9 @@ class ComputeTemplates(AnalyzerExtension): use_nodepipeline = False need_job_kwargs = True - def _set_params(self, ms_before: float = 1.0, ms_after: float = 2.0, operators=["average", "std"]): + def _set_params(self, ms_before: float = 1.0, ms_after: float = 2.0, operators=None): + if operators is None: + operators = ["average", "std"] assert isinstance(operators, list) for operator in operators: if isinstance(operator, str): diff --git a/src/spikeinterface/sortingcomponents/tests/test_waveforms/conftest.py b/src/spikeinterface/sortingcomponents/tests/test_waveforms/conftest.py index 0fc007ee50..152127ccd9 100644 --- a/src/spikeinterface/sortingcomponents/tests/test_waveforms/conftest.py +++ b/src/spikeinterface/sortingcomponents/tests/test_waveforms/conftest.py @@ -6,13 +6,13 @@ from spikeinterface.sortingcomponents.peak_detection import detect_peaks -@pytest.fixture(scope="package") +@pytest.fixture(scope="module") def chunk_executor_kwargs(): job_kwargs = dict(n_jobs=-1, chunk_size=10000, progress_bar=False) return job_kwargs -@pytest.fixture(scope="package") +@pytest.fixture(scope="module") def generated_recording(): recording, sorting = generate_ground_truth_recording( durations=[10.0], @@ -24,7 +24,7 @@ def generated_recording(): return recording -@pytest.fixture(scope="package") +@pytest.fixture(scope="module") def detected_peaks(generated_recording, chunk_executor_kwargs): recording = generated_recording peaks = detect_peaks(recording=recording, **chunk_executor_kwargs) diff --git a/src/spikeinterface/widgets/unit_waveforms.py b/src/spikeinterface/widgets/unit_waveforms.py index 74f1ae6788..8cd776b07e 100644 --- a/src/spikeinterface/widgets/unit_waveforms.py +++ b/src/spikeinterface/widgets/unit_waveforms.py @@ -95,7 +95,7 @@ def __init__( set_title=True, same_axis=False, shade_templates=True, - templates_percentile_shading=[1, 25, 75, 98], + templates_percentile_shading=[1, 25, 75, 99], x_offset_units=False, alpha_waveforms=0.5, alpha_templates=1,