Skip to content

Commit

Permalink
CellExplorer: fix tests and deprecation (#2048)
Browse files Browse the repository at this point in the history
* CellExplorer: fix tests and deprecation

* Drop session_info_matfile_path from __init__
  • Loading branch information
alejoe91 authored Sep 28, 2023
1 parent 93f02e8 commit 986fe6f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
21 changes: 0 additions & 21 deletions src/spikeinterface/extractors/cellexplorersortingextractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def __init__(
sampling_frequency: float | None = None,
session_info_file_path: str | Path | None = None,
spikes_matfile_path: str | Path | None = None,
session_info_matfile_path: str | Path | None = None,
):
try:
from pymatreader import read_mat
Expand All @@ -67,26 +66,6 @@ def __init__(
)
file_path = spikes_matfile_path if file_path is None else file_path

if session_info_matfile_path is not None:
# Raise an error if the warning period has expired
deprecation_issued = datetime.datetime(2023, 4, 1)
deprecation_deadline = deprecation_issued + datetime.timedelta(days=180)
if datetime.datetime.now() > deprecation_deadline:
raise ValueError(
"The session_info_matfile_path argument is no longer supported in. Use session_info_file_path instead."
)

# Otherwise, issue a DeprecationWarning
else:
warnings.warn(
"The session_info_matfile_path argument is deprecated and will be removed in six months. "
"Use session_info_file_path instead.",
DeprecationWarning,
)
session_info_file_path = (
session_info_matfile_path if session_info_file_path is None else session_info_file_path
)

self.spikes_cellinfo_path = Path(file_path)
self.session_path = self.spikes_cellinfo_path.parent
self.session_id = self.spikes_cellinfo_path.stem.split(".")[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class CellExplorerSortingTest(SortingCommonTestSuite, unittest.TestCase):
(
"cellexplorer/dataset_2/20170504_396um_0um_merge.spikes.cellinfo.mat",
{
"session_info_matfile_path": local_folder
"session_info_file_path": local_folder
/ "cellexplorer/dataset_2/20170504_396um_0um_merge.sessionInfo.mat"
},
),
Expand Down

0 comments on commit 986fe6f

Please sign in to comment.