Skip to content

Commit

Permalink
Merge pull request #602 from catalystneuro/deprecate_ced_name
Browse files Browse the repository at this point in the history
Deprecate CED Recording
  • Loading branch information
CodyCBakerPhD authored Oct 19, 2023
2 parents ec748f1 + 214ff88 commit 567213d
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 68 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# (Upcoming)

### Back-compatibility break
* The `CEDRecordingInterface` has now been removed; use the `Spike2RecordingInterface` instead. [PR #602](https://github.com/catalystneuro/neuroconv/pull/602)

### Features
Added `session_start_time` extraction to `FicTracDataInterface`. [PR #598](https://github.com/catalystneuro/neuroconv/pull/598)
* Added `session_start_time` extraction to `FicTracDataInterface`. [PR #598](https://github.com/catalystneuro/neuroconv/pull/598)
* Added `imaging_plane_name` keyword argument to `add_imaging_plane` function to determine which imaging plane to add from the metadata by name instead of `imaging_plane_index`.
Added reference for `imaging_plane` to default plane segmentation metadata. [PR #594](https://github.com/catalystneuro/neuroconv/pull/594)

### Fixes
Remove `starting_time` reset to default value (0.0) when adding the rate and updating the `photon_series_kwargs` or `roi_response_series_kwargs`, in `add_photon_series` or `add_fluorescence_traces`. [PR #595](https://github.com/catalystneuro/neuroconv/pull/595)
* Remove `starting_time` reset to default value (0.0) when adding the rate and updating the `photon_series_kwargs` or `roi_response_series_kwargs`, in `add_photon_series` or `add_fluorescence_traces`. [PR #595](https://github.com/catalystneuro/neuroconv/pull/595)

### Features

Expand Down
6 changes: 1 addition & 5 deletions src/neuroconv/datainterfaces/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@
PlexonRecordingInterface,
PlexonSortingInterface,
)
from .ecephys.spike2.spike2datainterface import (
CEDRecordingInterface,
Spike2RecordingInterface,
)
from .ecephys.spike2.spike2datainterface import Spike2RecordingInterface
from .ecephys.spikegadgets.spikegadgetsdatainterface import (
SpikeGadgetsRecordingInterface,
)
Expand Down Expand Up @@ -105,7 +102,6 @@
SpikeGLXNIDQInterface,
SpikeGadgetsRecordingInterface,
IntanRecordingInterface,
CEDRecordingInterface,
CellExplorerSortingInterface,
CellExplorerRecordingInterface,
CellExplorerLFPInterface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ class Spike2RecordingInterface(BaseRecordingExtractorInterface):
Data interface class for converting Spike2 data from CED (Cambridge Electronic
Design) using the :py:class:`~spikeinterface.extractors.CedRecordingExtractor`."""

keywords = BaseRecordingExtractorInterface.keywords + [
"CED",
]
keywords = BaseRecordingExtractorInterface.keywords + ["CED"]

ExtractorName = "CedRecordingExtractor"

Expand Down Expand Up @@ -59,22 +57,3 @@ def __init__(self, file_path: FilePathType, verbose: bool = True, es_key: str =
signal_channels = self.recording_extractor.neo_reader.header["signal_channels"]
channel_ids_of_raw_data = [channel_info[1] for channel_info in signal_channels if channel_info[4] == "mV"]
self.recording_extractor = self.recording_extractor.channel_slice(channel_ids=channel_ids_of_raw_data)


class CEDRecordingInterface(Spike2RecordingInterface):
def __init__(self, file_path: FilePathType, verbose: bool = True, es_key: str = "ElectricalSeries"):
"""
Initialize reading of CED file.
Parameters
----------
file_path : FilePathType
Path to .smr or .smrx file.
verbose : bool, default: True
es_key : str, default: "ElectricalSeries"
"""
warn(
message="CEDRecordingInterface will soon be deprecated. Please use Spike2RecordingInterface instead.",
category=DeprecationWarning,
)
super().__init__(file_path=file_path, verbose=verbose, es_key=es_key)
21 changes: 5 additions & 16 deletions tests/test_ecephys/test_ecephys_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from spikeinterface.extractors import NumpySorting

from neuroconv import NWBConverter
from neuroconv.datainterfaces import CEDRecordingInterface
from neuroconv.datainterfaces import Spike2RecordingInterface
from neuroconv.datainterfaces.ecephys.basesortingextractorinterface import (
BaseSortingExtractorInterface,
)
Expand Down Expand Up @@ -43,32 +43,21 @@ def test_stub_multi_segment(self):


class TestAssertions(TestCase):
@pytest.mark.skipif(
platform != "darwin" or python_version >= Version("3.8"),
reason="Only testing on MacOSX with Python 3.7!",
)
def test_ced_import_assertions_python_3_7(self):
with self.assertRaisesWith(
exc_type=ModuleNotFoundError,
exc_msg="\nThe package 'sonpy' is not available on the darwin platform for Python version 3.7!",
):
CEDRecordingInterface.get_all_channels_info(file_path="does_not_matter.smrx")

@pytest.mark.skipif(python_version.minor != 10, reason="Only testing with Python 3.10!")
def test_ced_import_assertions_3_10(self):
def test_spike2_import_assertions_3_10(self):
with self.assertRaisesWith(
exc_type=ModuleNotFoundError,
exc_msg="\nThe package 'sonpy' is not available for Python version 3.10!",
):
CEDRecordingInterface.get_all_channels_info(file_path="does_not_matter.smrx")
Spike2RecordingInterface.get_all_channels_info(file_path="does_not_matter.smrx")

@pytest.mark.skipif(python_version.minor != 11, reason="Only testing with Python 3.11!")
def test_ced_import_assertions_3_11(self):
def test_spike2_import_assertions_3_11(self):
with self.assertRaisesWith(
exc_type=ModuleNotFoundError,
exc_msg="\nThe package 'sonpy' is not available for Python version 3.11!",
):
CEDRecordingInterface.get_all_channels_info(file_path="does_not_matter.smrx")
Spike2RecordingInterface.get_all_channels_info(file_path="does_not_matter.smrx")


class TestSortingInterface(unittest.TestCase):
Expand Down
20 changes: 0 additions & 20 deletions tests/test_on_data/test_gin_ecephys/test_raw_recordings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
AxonaRecordingInterface,
BiocamRecordingInterface,
BlackrockRecordingInterface,
CEDRecordingInterface,
EDFRecordingInterface,
IntanRecordingInterface,
MaxOneRecordingInterface,
Expand Down Expand Up @@ -139,15 +138,6 @@ class TestEcephysRawRecordingsNwbConversions(unittest.TestCase):
),
]

this_python_version = version.parse(python_version())
if system() != "Darwin" and version.parse("3.8") <= this_python_version < version.parse("3.10"):
parameterized_recording_list.append(
param(
data_interface=CEDRecordingInterface,
interface_kwargs=dict(file_path=str(DATA_PATH / "spike2" / "m365_1sec.smrx")),
case_name="smrx",
)
)
if system() == "Linux":
parameterized_recording_list.append(
param(
Expand Down Expand Up @@ -188,16 +178,6 @@ class TestEcephysRawRecordingsNwbConversions(unittest.TestCase):
]
)

this_python_version = version.parse(python_version())
if system() != "Darwin" and version.parse("3.8") <= this_python_version < version.parse("3.10"):
parameterized_recording_list.append(
param(
data_interface=CEDRecordingInterface,
interface_kwargs=dict(file_path=str(DATA_PATH / "spike2" / "m365_1sec.smrx")),
case_name="smrx",
)
)

for suffix in ["rhd", "rhs"]:
parameterized_recording_list.append(
param(
Expand Down
6 changes: 3 additions & 3 deletions tests/test_on_data/test_recording_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
AxonaRecordingInterface,
BiocamRecordingInterface,
BlackrockRecordingInterface,
CEDRecordingInterface,
CellExplorerRecordingInterface,
EDFRecordingInterface,
IntanRecordingInterface,
Expand All @@ -27,6 +26,7 @@
OpenEphysLegacyRecordingInterface,
OpenEphysRecordingInterface,
PlexonRecordingInterface,
Spike2RecordingInterface,
SpikeGadgetsRecordingInterface,
SpikeGLXRecordingInterface,
TdtRecordingInterface,
Expand Down Expand Up @@ -81,8 +81,8 @@ class TestBlackrockRecordingInterface(RecordingExtractorInterfaceTestMixin, Test
platform == "darwin" or this_python_version < version.parse("3.8") or this_python_version > version.parse("3.9"),
reason="Interface unsupported for OSX. Only runs on Python 3.8 and 3.9",
)
class TestCEDRecordingInterface(RecordingExtractorInterfaceTestMixin, TestCase):
data_interface_cls = CEDRecordingInterface
class TestSpike2RecordingInterface(RecordingExtractorInterfaceTestMixin, TestCase):
data_interface_cls = Spike2RecordingInterface
interface_kwargs = dict(file_path=str(DATA_PATH / "spike2" / "m365_1sec.smrx"))
save_directory = OUTPUT_PATH

Expand Down

0 comments on commit 567213d

Please sign in to comment.