From ee3d5fd9d738157afe6eeccf0feb55658b1a979b Mon Sep 17 00:00:00 2001 From: chrishalcrow Date: Fri, 26 Apr 2024 11:55:16 +0100 Subject: [PATCH 1/3] Speed up test_sorting_s3_nwb_zarr --- .../extractors/tests/test_nwbextractors_streaming.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/spikeinterface/extractors/tests/test_nwbextractors_streaming.py b/src/spikeinterface/extractors/tests/test_nwbextractors_streaming.py index f4beff1262..a1a1f6a37c 100644 --- a/src/spikeinterface/extractors/tests/test_nwbextractors_streaming.py +++ b/src/spikeinterface/extractors/tests/test_nwbextractors_streaming.py @@ -290,7 +290,15 @@ def test_sorting_s3_nwb_zarr(tmp_path): # test to/from dict sorting_loaded = load_extractor(sorting.to_dict()) - check_sortings_equal(sorting, sorting_loaded) + + # just take 3 random units to test + rng = np.random.default_rng(seed=2205) + three_unit_ids = rng.choice(sorting.unit_ids, size=3) + sorting_sub = sorting.select_units(unit_ids = three_unit_ids) + sorting_loaded_sub = sorting_loaded.select_units(unit_ids = three_unit_ids) + + # test to/from dict + check_sortings_equal(sorting_sub, sorting_loaded_sub) if __name__ == "__main__": From 75f45e6c50b1684635fd51615f4823db664cd06e Mon Sep 17 00:00:00 2001 From: chrishalcrow Date: Fri, 26 Apr 2024 12:58:21 +0100 Subject: [PATCH 2/3] Remove a duplicate comment --- .../extractors/tests/test_nwbextractors_streaming.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/spikeinterface/extractors/tests/test_nwbextractors_streaming.py b/src/spikeinterface/extractors/tests/test_nwbextractors_streaming.py index a1a1f6a37c..a8874c8cc6 100644 --- a/src/spikeinterface/extractors/tests/test_nwbextractors_streaming.py +++ b/src/spikeinterface/extractors/tests/test_nwbextractors_streaming.py @@ -297,7 +297,6 @@ def test_sorting_s3_nwb_zarr(tmp_path): sorting_sub = sorting.select_units(unit_ids = three_unit_ids) sorting_loaded_sub = sorting_loaded.select_units(unit_ids = three_unit_ids) - # test to/from dict check_sortings_equal(sorting_sub, sorting_loaded_sub) From 31111bac17ce83a42086210a04dc175e9a25c006 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 26 Apr 2024 12:01:48 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../extractors/tests/test_nwbextractors_streaming.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spikeinterface/extractors/tests/test_nwbextractors_streaming.py b/src/spikeinterface/extractors/tests/test_nwbextractors_streaming.py index a8874c8cc6..47d7aea64b 100644 --- a/src/spikeinterface/extractors/tests/test_nwbextractors_streaming.py +++ b/src/spikeinterface/extractors/tests/test_nwbextractors_streaming.py @@ -294,8 +294,8 @@ def test_sorting_s3_nwb_zarr(tmp_path): # just take 3 random units to test rng = np.random.default_rng(seed=2205) three_unit_ids = rng.choice(sorting.unit_ids, size=3) - sorting_sub = sorting.select_units(unit_ids = three_unit_ids) - sorting_loaded_sub = sorting_loaded.select_units(unit_ids = three_unit_ids) + sorting_sub = sorting.select_units(unit_ids=three_unit_ids) + sorting_loaded_sub = sorting_loaded.select_units(unit_ids=three_unit_ids) check_sortings_equal(sorting_sub, sorting_loaded_sub)