Skip to content

Commit e580139

Browse files
authored
Merge branch 'main' into channel-ids-sortingview
2 parents fcfd519 + cfffc6c commit e580139

21 files changed

+253
-46
lines changed

src/spikeinterface/extractors/neoextractors/alphaomega.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,30 @@ class AlphaOmegaRecordingExtractor(NeoBaseRecordingExtractor):
2525
If there are several streams, specify the stream name you want to load.
2626
all_annotations : bool, default: False
2727
Load exhaustively all annotations from neo.
28+
use_names_as_ids : bool, default: False
29+
Determines the format of the channel IDs used by the extractor. If set to True, the channel IDs will be the
30+
names from NeoRawIO. If set to False, the channel IDs will be the ids provided by NeoRawIO.
2831
"""
2932

3033
NeoRawIOClass = "AlphaOmegaRawIO"
3134

32-
def __init__(self, folder_path, lsx_files=None, stream_id="RAW", stream_name=None, all_annotations=False):
35+
def __init__(
36+
self,
37+
folder_path,
38+
lsx_files=None,
39+
stream_id="RAW",
40+
stream_name=None,
41+
all_annotations: bool = False,
42+
use_names_as_ids: bool = False,
43+
):
3344
neo_kwargs = self.map_to_neo_kwargs(folder_path, lsx_files)
3445
NeoBaseRecordingExtractor.__init__(
35-
self, stream_id=stream_id, stream_name=stream_name, all_annotations=all_annotations, **neo_kwargs
46+
self,
47+
stream_id=stream_id,
48+
stream_name=stream_name,
49+
all_annotations=all_annotations,
50+
use_names_as_ids=use_names_as_ids,
51+
**neo_kwargs,
3652
)
3753
self._kwargs.update(dict(folder_path=str(Path(folder_path).absolute()), lsx_files=lsx_files))
3854

src/spikeinterface/extractors/neoextractors/axona.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,21 @@ class AxonaRecordingExtractor(NeoBaseRecordingExtractor):
1919
The file path to load the recordings from.
2020
all_annotations : bool, default: False
2121
Load exhaustively all annotations from neo.
22+
use_names_as_ids : bool, default: False
23+
Determines the format of the channel IDs used by the extractor. If set to True, the channel IDs will be the
24+
names from NeoRawIO. If set to False, the channel IDs will be the ids provided by NeoRawIO.
2225
"""
2326

2427
NeoRawIOClass = "AxonaRawIO"
2528

26-
def __init__(self, file_path, all_annotations=False):
29+
def __init__(self, file_path: str | Path, all_annotations: bool = False, use_names_as_ids: bool = False):
2730
neo_kwargs = self.map_to_neo_kwargs(file_path)
28-
NeoBaseRecordingExtractor.__init__(self, all_annotations=all_annotations, **neo_kwargs)
31+
NeoBaseRecordingExtractor.__init__(
32+
self,
33+
all_annotations=all_annotations,
34+
use_names_as_ids=use_names_as_ids,
35+
**neo_kwargs,
36+
)
2937
self._kwargs.update({"file_path": str(Path(file_path).absolute())})
3038

3139
@classmethod

src/spikeinterface/extractors/neoextractors/biocam.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ class BiocamRecordingExtractor(NeoBaseRecordingExtractor):
2929
If there are several streams, specify the stream name you want to load.
3030
all_annotations : bool, default: False
3131
Load exhaustively all annotations from neo.
32+
use_names_as_ids : bool, default: False
33+
Determines the format of the channel IDs used by the extractor. If set to True, the channel IDs will be the
34+
names from NeoRawIO. If set to False, the channel IDs will be the ids provided by NeoRawIO.
3235
"""
3336

3437
NeoRawIOClass = "BiocamRawIO"
@@ -40,11 +43,17 @@ def __init__(
4043
electrode_width=None,
4144
stream_id=None,
4245
stream_name=None,
43-
all_annotations=False,
46+
all_annotations: bool = False,
47+
use_names_as_ids: bool = False,
4448
):
4549
neo_kwargs = self.map_to_neo_kwargs(file_path)
4650
NeoBaseRecordingExtractor.__init__(
47-
self, stream_id=stream_id, stream_name=stream_name, all_annotations=all_annotations, **neo_kwargs
51+
self,
52+
stream_id=stream_id,
53+
stream_name=stream_name,
54+
all_annotations=all_annotations,
55+
use_names_as_ids=use_names_as_ids,
56+
**neo_kwargs,
4857
)
4958

5059
# load probe from probeinterface

src/spikeinterface/extractors/neoextractors/blackrock.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ class BlackrockRecordingExtractor(NeoBaseRecordingExtractor):
2727
all_annotations : bool, default: False
2828
Load exhaustively all annotations from neo.
2929
use_names_as_ids : bool, default: False
30-
If False, use default IDs inherited from Neo. If True, use channel names as IDs.
30+
Determines the format of the channel IDs used by the extractor. If set to True, the channel IDs will be the
31+
names from NeoRawIO. If set to False, the channel IDs will be the ids provided by NeoRawIO.
3132
3233
"""
3334

@@ -38,8 +39,8 @@ def __init__(
3839
file_path,
3940
stream_id=None,
4041
stream_name=None,
41-
all_annotations=False,
42-
use_names_as_ids=False,
42+
all_annotations: bool = False,
43+
use_names_as_ids: bool = False,
4344
):
4445
neo_kwargs = self.map_to_neo_kwargs(file_path)
4546
neo_kwargs["load_nev"] = False # Avoid loading spikes release in neo 0.12.0

src/spikeinterface/extractors/neoextractors/ced.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,24 @@ class CedRecordingExtractor(NeoBaseRecordingExtractor):
2525
If there are several streams, specify the stream name you want to load.
2626
all_annotations : bool, default: False
2727
Load exhaustively all annotations from neo.
28+
use_names_as_ids : bool, default: False
29+
Determines the format of the channel IDs used by the extractor. If set to True, the channel IDs will be the
30+
names from NeoRawIO. If set to False, the channel IDs will be the ids provided by NeoRawIO.
2831
"""
2932

3033
NeoRawIOClass = "CedRawIO"
3134

32-
def __init__(self, file_path, stream_id=None, stream_name=None, all_annotations=False):
35+
def __init__(
36+
self, file_path, stream_id=None, stream_name=None, all_annotations: bool = False, use_names_as_ids: bool = False
37+
):
3338
neo_kwargs = self.map_to_neo_kwargs(file_path)
3439
NeoBaseRecordingExtractor.__init__(
35-
self, stream_id=stream_id, stream_name=stream_name, all_annotations=all_annotations, **neo_kwargs
40+
self,
41+
stream_id=stream_id,
42+
stream_name=stream_name,
43+
all_annotations=all_annotations,
44+
use_names_as_ids=use_names_as_ids,
45+
**neo_kwargs,
3646
)
3747
self._kwargs.update(dict(file_path=str(Path(file_path).absolute())))
3848
self.extra_requirements.append("neo[ced]")

src/spikeinterface/extractors/neoextractors/edf.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,29 @@ class EDFRecordingExtractor(NeoBaseRecordingExtractor):
2424
If there are several streams, specify the stream name you want to load.
2525
all_annotations: bool, default: False
2626
Load exhaustively all annotations from neo.
27+
use_names_as_ids : bool, default: False
28+
Determines the format of the channel IDs used by the extractor. If set to True, the channel IDs will be the
29+
names from NeoRawIO. If set to False, the channel IDs will be the ids provided by NeoRawIO.
2730
"""
2831

2932
NeoRawIOClass = "EDFRawIO"
3033

31-
def __init__(self, file_path, stream_id=None, stream_name=None, all_annotations=False):
34+
def __init__(
35+
self,
36+
file_path,
37+
stream_id=None,
38+
stream_name=None,
39+
all_annotations: bool = False,
40+
use_names_as_ids: bool = False,
41+
):
3242
neo_kwargs = {"filename": str(file_path)}
3343
NeoBaseRecordingExtractor.__init__(
34-
self, stream_id=stream_id, stream_name=stream_name, all_annotations=all_annotations, **neo_kwargs
44+
self,
45+
stream_id=stream_id,
46+
stream_name=stream_name,
47+
all_annotations=all_annotations,
48+
use_names_as_ids=use_names_as_ids,
49+
**neo_kwargs,
3550
)
3651
self._kwargs.update({"file_path": str(Path(file_path).absolute())})
3752
self.extra_requirements.append("neo[edf]")

src/spikeinterface/extractors/neoextractors/intan.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ class IntanRecordingExtractor(NeoBaseRecordingExtractor):
2828
check we perform is that timestamps are continuous. Setting this to True will ignore this check and set
2929
the attribute `discontinuous_timestamps` to True in the underlying neo object.
3030
use_names_as_ids : bool, default: False
31-
If False, use default IDs inherited from Neo. If True, use channel names as IDs.
31+
Determines the format of the channel IDs used by the extractor. If set to True, the channel IDs will be the
32+
names from NeoRawIO. If set to False, the channel IDs will be the ids provided by NeoRawIO.
33+
34+
In Intan the ids provided by NeoRawIO are the hardware channel ids while the names are custom names given by
35+
the user
3236
3337
3438
"""

src/spikeinterface/extractors/neoextractors/maxwell.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ class MaxwellRecordingExtractor(NeoBaseRecordingExtractor):
3030
If there are several streams, specify the stream name you want to load.
3131
all_annotations : bool, default: False
3232
Load exhaustively all annotations from neo.
33+
use_names_as_ids : bool, default: False
34+
Determines the format of the channel IDs used by the extractor. If set to True, the channel IDs will be the
35+
names from NeoRawIO. If set to False, the channel IDs will be the ids provided by NeoRawIO.
3336
rec_name : str, default: None
3437
When the file contains several recordings you need to specify the one
3538
you want to extract. (rec_name='rec0000').
@@ -50,6 +53,7 @@ def __init__(
5053
all_annotations=False,
5154
rec_name=None,
5255
install_maxwell_plugin=False,
56+
use_names_as_ids: bool = False,
5357
):
5458
if install_maxwell_plugin:
5559
self.install_maxwell_plugin()
@@ -61,6 +65,7 @@ def __init__(
6165
stream_name=stream_name,
6266
block_index=block_index,
6367
all_annotations=all_annotations,
68+
use_names_as_ids=use_names_as_ids,
6469
**neo_kwargs,
6570
)
6671

src/spikeinterface/extractors/neoextractors/mcsraw.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,30 @@ class MCSRawRecordingExtractor(NeoBaseRecordingExtractor):
2828
If there are several blocks, specify the block index you want to load.
2929
all_annotations : bool, default: False
3030
Load exhaustively all annotations from neo.
31+
use_names_as_ids : bool, default: False
32+
Determines the format of the channel IDs used by the extractor. If set to True, the channel IDs will be the
33+
names from NeoRawIO. If set to False, the channel IDs will be the ids provided by NeoRawIO.
3134
"""
3235

3336
NeoRawIOClass = "RawMCSRawIO"
3437

35-
def __init__(self, file_path, stream_id=None, stream_name=None, block_index=None, all_annotations=False):
38+
def __init__(
39+
self,
40+
file_path,
41+
stream_id=None,
42+
stream_name=None,
43+
block_index=None,
44+
all_annotations=False,
45+
use_names_as_ids: bool = False,
46+
):
3647
neo_kwargs = self.map_to_neo_kwargs(file_path)
3748
NeoBaseRecordingExtractor.__init__(
3849
self,
3950
stream_id=stream_id,
4051
stream_name=stream_name,
4152
block_index=block_index,
4253
all_annotations=all_annotations,
54+
use_names_as_ids=use_names_as_ids,
4355
**neo_kwargs,
4456
)
4557
self._kwargs.update(dict(file_path=str(Path(file_path).absolute())))

src/spikeinterface/extractors/neoextractors/mearec.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,21 @@ class MEArecRecordingExtractor(NeoBaseRecordingExtractor):
3838
The file path to load the recordings from.
3939
all_annotations : bool, default: False
4040
Load exhaustively all annotations from neo.
41+
use_names_as_ids : bool, default: False
42+
Determines the format of the channel IDs used by the extractor. If set to True, the channel IDs will be the
43+
names from NeoRawIO. If set to False, the channel IDs will be the ids provided by NeoRawIO.
4144
"""
4245

4346
NeoRawIOClass = "MEArecRawIO"
4447

45-
def __init__(self, file_path: Union[str, Path], all_annotations: bool = False):
48+
def __init__(self, file_path: Union[str, Path], all_annotations: bool = False, use_names_as_ids: bool = False):
4649
neo_kwargs = self.map_to_neo_kwargs(file_path)
47-
NeoBaseRecordingExtractor.__init__(self, all_annotations=all_annotations, **neo_kwargs)
50+
NeoBaseRecordingExtractor.__init__(
51+
self,
52+
all_annotations=all_annotations,
53+
use_names_as_ids=use_names_as_ids,
54+
**neo_kwargs,
55+
)
4856

4957
self.extra_requirements.append("mearec")
5058

0 commit comments

Comments
 (0)