From 9addc5769dc7beb019a98715a87fcce681f6e3cb Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Fri, 13 Oct 2023 16:04:00 -0400 Subject: [PATCH] Fix grouping of OpenEphys NPIX --- examples/modules_gallery/qualitymetrics/plot_4_curation.py | 2 +- src/spikeinterface/extractors/neoextractors/openephys.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/modules_gallery/qualitymetrics/plot_4_curation.py b/examples/modules_gallery/qualitymetrics/plot_4_curation.py index c66f55f221..8953a5a835 100644 --- a/examples/modules_gallery/qualitymetrics/plot_4_curation.py +++ b/examples/modules_gallery/qualitymetrics/plot_4_curation.py @@ -61,4 +61,4 @@ curated_sorting = sorting.select_units(keep_unit_ids) print(curated_sorting) -se.NpzSortingExtractor.write_sorting(curated_sorting, 'curated_sorting.pnz') +se.NpzSortingExtractor.write_sorting(curated_sorting, 'curated_sorting.npz') diff --git a/src/spikeinterface/extractors/neoextractors/openephys.py b/src/spikeinterface/extractors/neoextractors/openephys.py index cd2b6fb941..bb3ae3435a 100644 --- a/src/spikeinterface/extractors/neoextractors/openephys.py +++ b/src/spikeinterface/extractors/neoextractors/openephys.py @@ -183,7 +183,10 @@ def __init__( probe = None if probe is not None: - self = self.set_probe(probe, in_place=True) + if probe.shank_ids is not None: + self.set_probe(probe, in_place=True, group_mode="by_shank") + else: + self.set_probe(probe, in_place=True) probe_name = probe.annotations["probe_name"] # load num_channels_per_adc depending on probe type if "2.0" in probe_name: