Skip to content

Commit 1f6d40c

Browse files
committed
deprecate get_rawio_class add get_rawio
1 parent 354c8d9 commit 1f6d40c

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

neo/rawio/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,18 @@
246246
WinWcpRawIO,
247247
]
248248

249-
250249
def get_rawio_class(filename_or_dirname):
250+
"""Legacy function for returning class guess from file extension
251+
DEPRECATED
252+
"""
253+
254+
import warnings
255+
warnings.warn('get_rawio_class is deprecated. In the future please use get_rawio')
256+
257+
return get_rawio(filename_or_dirname)
258+
259+
260+
def get_rawio(filename_or_dirname):
251261
"""
252262
Return a neo.rawio class guess from file extension.
253263
"""

neo/test/rawiotest/test_get_rawio.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from neo.rawio import get_rawio_class
1+
from neo.rawio import get_rawio
22
from pathlib import Path
33
from tempfile import TemporaryDirectory
44

@@ -7,7 +7,7 @@ def test_get_rawio_class():
77
# use plexon io suffix for testing here
88
non_existant_file = Path('non_existant_folder/non_existant_file.plx')
99
non_existant_file.unlink(missing_ok=True)
10-
ios = get_rawio_class(non_existant_file)
10+
ios = get_rawio(non_existant_file)
1111

1212
assert ios
1313

@@ -19,7 +19,7 @@ def test_get_rawio_class_nonsupported_rawio():
1919

2020
non_existant_file = Path('non_existant_folder/non_existant_file.fake')
2121
non_existant_file.unlink(missing_ok=True)
22-
ios = get_rawio_class(non_existant_file)
22+
ios = get_rawio(non_existant_file)
2323

2424
assert ios is None
2525

0 commit comments

Comments
 (0)