Skip to content

Commit a55fb0e

Browse files
authored
Remove load sync channel (#4466)
1 parent ad97c0f commit a55fb0e

1 file changed

Lines changed: 6 additions & 25 deletions

File tree

src/spikeinterface/extractors/neoextractors/openephys.py

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,6 @@ class OpenEphysBinaryRecordingExtractor(NeoBaseRecordingExtractor):
130130
Alternative way to specify which experiment to load using a zero-based index.
131131
block_index=0 corresponds to experiment1, block_index=1 to experiment2, etc.
132132
Cannot be used together with experiment_name.
133-
load_sync_channel : bool, default: False
134-
**DEPRECATED: Use stream_name or stream_id to load sync streams. Will be removed in version 0.104.0**
135-
If False (default) and a SYNC channel is present (e.g., Neuropixels), this is not loaded.
136-
If True, the SYNC channel is loaded and can be accessed in the analog signals.
137133
load_sync_timestamps : bool, default: False
138134
If True, the synchronized_timestamps are loaded and set as times to the recording.
139135
If False (default), only the t_start and sampling rate are set, and timestamps are assumed
@@ -224,7 +220,6 @@ def __init__(
224220
stream_id: str = None,
225221
stream_name: str = None,
226222
block_index: int = None,
227-
load_sync_channel: bool = False,
228223
load_sync_timestamps: bool = False,
229224
experiment_names: str | list | None = None,
230225
all_annotations: bool = False,
@@ -275,16 +270,9 @@ def __init__(
275270
# Single experiment: no filtering needed, let base class handle it
276271
block_index = None
277272

278-
if load_sync_channel:
279-
warning_message = (
280-
"OpenEphysBinaryRecordingExtractor: `load_sync_channel` is deprecated and will "
281-
"be removed in version 0.104, use the `stream_name` or `stream_id` to load the sync stream if needed"
282-
)
283-
warnings.warn(warning_message, DeprecationWarning, stacklevel=2)
284-
285273
stream_is_not_specified = stream_name is None and stream_id is None
286274
if stream_is_not_specified:
287-
available_stream_names, _ = self.get_streams(folder_path, load_sync_channel, experiment_names_for_neo)
275+
available_stream_names, _ = self.get_streams(folder_path, experiment_names_for_neo)
288276

289277
# Auto-select neural data stream when there are exactly two streams (neural + sync)
290278
# and no stream was explicitly specified
@@ -294,7 +282,7 @@ def __init__(
294282
neural_stream_name = next(stream for stream in available_stream_names if "SYNC" not in stream)
295283
stream_name = neural_stream_name
296284

297-
neo_kwargs = self.map_to_neo_kwargs(folder_path, load_sync_channel, experiment_names_for_neo)
285+
neo_kwargs = self.map_to_neo_kwargs(folder_path, experiment_names_for_neo)
298286
NeoBaseRecordingExtractor.__init__(
299287
self,
300288
stream_id=stream_id,
@@ -307,7 +295,7 @@ def __init__(
307295
stream_is_sync = "SYNC" in self.stream_name
308296
if not stream_is_sync:
309297
# get streams to find correct probe
310-
stream_names, stream_ids = self.get_streams(folder_path, load_sync_channel, experiment_names_for_neo)
298+
stream_names, stream_ids = self.get_streams(folder_path, experiment_names_for_neo)
311299
if stream_name is None and stream_id is None:
312300
stream_name = stream_names[0]
313301
elif stream_name is None:
@@ -327,8 +315,8 @@ def __init__(
327315
exp_id = exp_ids[block_index]
328316
rec_ids = sorted(list(node_structure["experiments"][exp_id]["recordings"].keys()))
329317

330-
# do not load probe for NIDQ stream or if load_sync_channel is True
331-
if "NI-DAQmx" not in stream_name and not load_sync_channel:
318+
# do not load probe for NIDQ stream
319+
if "NI-DAQmx" not in stream_name:
332320
settings_file = node_structure["experiments"][exp_id]["settings_file"]
333321

334322
if Path(settings_file).is_file():
@@ -377,16 +365,14 @@ def __init__(
377365
dict(
378366
folder_path=str(Path(folder_path).absolute()),
379367
experiment_name=experiment_name,
380-
load_sync_channel=load_sync_channel,
381368
load_sync_timestamps=load_sync_timestamps,
382369
)
383370
)
384371

385372
@classmethod
386-
def map_to_neo_kwargs(cls, folder_path, load_sync_channel=False, experiment_names=None):
373+
def map_to_neo_kwargs(cls, folder_path, experiment_names=None):
387374
neo_kwargs = {
388375
"dirname": str(folder_path),
389-
"load_sync_channel": load_sync_channel,
390376
"experiment_names": experiment_names,
391377
}
392378
return neo_kwargs
@@ -502,11 +488,6 @@ def read_openephys(folder_path, **kwargs):
502488
Cannot be used together with experiment_name.
503489
all_annotations : bool, default: False
504490
Load exhaustively all annotation from neo
505-
load_sync_channel : bool, default: False
506-
**DEPRECATED: Use stream_name or stream_id to load sync streams**
507-
If False (default) and a SYNC channel is present (e.g. Neuropixels), this is not loaded.
508-
If True, the SYNC channel is loaded and can be accessed in the analog signals.
509-
For open ephys binary format only
510491
load_sync_timestamps : bool, default: False
511492
If True, the synchronized_timestamps are loaded and set as times to the recording.
512493
If False (default), only the t_start and sampling rate are set, and timestamps are assumed

0 commit comments

Comments
 (0)