Skip to content

Commit

Permalink
Merge pull request #2845 from h-mayorquin/avoid_duplicating_channel_n…
Browse files Browse the repository at this point in the history
…ames_as_property

Avoid duplicating channel names as property in neo base extractor when `all_annotations=True`
  • Loading branch information
samuelgarcia authored May 21, 2024
2 parents 2325958 + 6565db6 commit d66f8eb
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit d66f8eb

Please sign in to comment.