Skip to content

Commit b338357

Browse files
authored
Merge pull request #3193 from h-mayorquin/plexon_use_names_as_ids
Use names as ids in Plexon1 recording extractor
2 parents 53933e6 + ec05c1d commit b338357

File tree

1 file changed

+22
-3
lines changed
  • src/spikeinterface/extractors/neoextractors

1 file changed

+22
-3
lines changed

src/spikeinterface/extractors/neoextractors/plexon.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,41 @@ class PlexonRecordingExtractor(NeoBaseRecordingExtractor):
1515
1616
Parameters
1717
----------
18-
file_path : str
18+
file_path : str | Path
1919
The file path to load the recordings from.
2020
stream_id : str, default: None
2121
If there are several streams, specify the stream id you want to load.
2222
stream_name : str, default: None
2323
If there are several streams, specify the stream name you want to load.
2424
all_annotations : bool, default: False
2525
Load exhaustively all annotations from neo.
26+
use_names_as_ids : bool, default: True
27+
Determines the format of the channel IDs used by the extractor. If set to True, the channel IDs will be the
28+
names from NeoRawIO. If set to False, the channel IDs will be the ids provided by NeoRawIO.
29+
30+
Example for wideband signals:
31+
names: ["WB01", "WB02", "WB03", "WB04"]
32+
ids: ["0" , "1", "2", "3"]
2633
"""
2734

2835
NeoRawIOClass = "PlexonRawIO"
2936

30-
def __init__(self, file_path, stream_id=None, stream_name=None, all_annotations=False):
37+
def __init__(
38+
self,
39+
file_path: str | Path,
40+
stream_id=None,
41+
stream_name=None,
42+
all_annotations: bool = False,
43+
use_names_as_ids: bool = True,
44+
):
3145
neo_kwargs = self.map_to_neo_kwargs(file_path)
3246
NeoBaseRecordingExtractor.__init__(
33-
self, stream_id=stream_id, stream_name=stream_name, all_annotations=all_annotations, **neo_kwargs
47+
self,
48+
stream_id=stream_id,
49+
stream_name=stream_name,
50+
all_annotations=all_annotations,
51+
use_names_as_ids=use_names_as_ids,
52+
**neo_kwargs,
3453
)
3554
self._kwargs.update({"file_path": str(Path(file_path).resolve())})
3655

0 commit comments

Comments
 (0)