Skip to content

Commit

Permalink
Merge pull request #1323 from zm711/get_rawio
Browse files Browse the repository at this point in the history
Change `get_rawio_class` to `get_rawio`
  • Loading branch information
apdavison authored Oct 10, 2023
2 parents 26e1565 + 1f6d40c commit 443bbb7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
12 changes: 11 additions & 1 deletion neo/rawio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,18 @@
WinWcpRawIO,
]


def get_rawio_class(filename_or_dirname):
"""Legacy function for returning class guess from file extension
DEPRECATED
"""

import warnings
warnings.warn('get_rawio_class is deprecated. In the future please use get_rawio')

return get_rawio(filename_or_dirname)


def get_rawio(filename_or_dirname):
"""
Return a neo.rawio class guess from file extension.
"""
Expand Down
6 changes: 3 additions & 3 deletions neo/test/rawiotest/test_get_rawio.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from neo.rawio import get_rawio_class
from neo.rawio import get_rawio
from pathlib import Path
from tempfile import TemporaryDirectory

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

assert ios

Expand All @@ -19,7 +19,7 @@ def test_get_rawio_class_nonsupported_rawio():

non_existant_file = Path('non_existant_folder/non_existant_file.fake')
non_existant_file.unlink(missing_ok=True)
ios = get_rawio_class(non_existant_file)
ios = get_rawio(non_existant_file)

assert ios is None

Expand Down

0 comments on commit 443bbb7

Please sign in to comment.