diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b67143bb9..f2599b452b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Removals, Deprecations and Changes ## Bug Fixes +* Fix a bug for avoiding loading the sync stream in `SpikeGLXConverterPipe` [PR #1373](https://github.com/catalystneuro/neuroconv/pull/1373) ## Features * Extra optional kwargs to `BlackrockRecordingInterface` and `BlackrockSortingInterface` for finer control of the neo reader [PR #12](https://github.com/catalystneuro/neuroconv/pull/1290) diff --git a/src/neuroconv/datainterfaces/ecephys/spikeglx/spikeglxconverter.py b/src/neuroconv/datainterfaces/ecephys/spikeglx/spikeglxconverter.py index 14ce99c0d5..d086d78aa7 100644 --- a/src/neuroconv/datainterfaces/ecephys/spikeglx/spikeglxconverter.py +++ b/src/neuroconv/datainterfaces/ecephys/spikeglx/spikeglxconverter.py @@ -88,8 +88,10 @@ def __init__( data_interfaces = dict() nidq_streams = [stream_id for stream_id in streams_ids if stream_id == "nidq"] - electrical_streams = [stream_id for stream_id in streams_ids if stream_id not in nidq_streams] - for stream_id in electrical_streams: + sync_streams = [stream_id for stream_id in streams_ids if "SYNC" in stream_id] + stream_is_neural = lambda stream_id: stream_id not in nidq_streams and "SYNC" not in sync_streams + neural_streams = [stream_id for stream_id in streams_ids if stream_is_neural(stream_id)] + for stream_id in neural_streams: data_interfaces[stream_id] = SpikeGLXRecordingInterface(folder_path=folder_path, stream_id=stream_id) for stream_id in nidq_streams: diff --git a/src/neuroconv/datainterfaces/ecephys/spikeglx/spikeglxdatainterface.py b/src/neuroconv/datainterfaces/ecephys/spikeglx/spikeglxdatainterface.py index b09d00fab2..ff31ed718d 100644 --- a/src/neuroconv/datainterfaces/ecephys/spikeglx/spikeglxdatainterface.py +++ b/src/neuroconv/datainterfaces/ecephys/spikeglx/spikeglxdatainterface.py @@ -71,6 +71,11 @@ def __init__( "SpikeGLXRecordingInterface is not designed to handle nidq files. Use SpikeGLXNIDQInterface instead" ) + if stream_id is not None and "SYNC" in stream_id: + raise ValueError( + "SpikeGLXRecordingInterface is not designed to handle the SYNC stream. Open an issue if you need this functionality." + ) + if file_path is not None: warnings.warn( "file_path is deprecated and will be removed by the end of 2025. "