From 6565db6e7cbee68aa9d31ccff57dc0664cdcb2aa Mon Sep 17 00:00:00 2001 From: Heberto Mayorquin Date: Tue, 14 May 2024 08:34:07 -0600 Subject: [PATCH] avoid duplicating channel names as property when all_annotations=True --- .../extractors/neoextractors/neobaseextractor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/spikeinterface/extractors/neoextractors/neobaseextractor.py b/src/spikeinterface/extractors/neoextractors/neobaseextractor.py index 1620a6882d..c30c6b94f0 100644 --- a/src/spikeinterface/extractors/neoextractors/neobaseextractor.py +++ b/src/spikeinterface/extractors/neoextractors/neobaseextractor.py @@ -179,6 +179,7 @@ def __init__( If True, include all annotations in the extracted data. use_names_as_ids : Optional[bool], default: None If True, use channel names as IDs. Otherwise, use default IDs. + In NEO the ids are guaranteed to be unique. Names are user defined and can be duplicated. neo_kwargs : Dict[str, Any] Additional keyword arguments to pass to the NeoBaseExtractor for initialization. @@ -275,8 +276,8 @@ def __init__( self.set_property("gain_to_uV", final_gains) self.set_property("offset_to_uV", final_offsets) - if not use_names_as_ids: - self.set_property("channel_name", signal_channels["name"]) + if not use_names_as_ids and not all_annotations: + self.set_property("channel_names", signal_channels["name"]) if all_annotations: block_ann = self.neo_reader.raw_annotations["blocks"][self.block_index]