Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions neo/rawio/cedrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
def _get_sonpy_namespace():
"""Return the sonpy namespace exposing SonFile, whatever the installed layout."""
if importlib.util.find_spec("sonpy") is None:
raise ImportError("sonpy is not installed. Install it with `pip install sonpy`.")
raise ImportError(
"sonpy is not installed. sonpy only publishes wheels for Windows, and for Linux and macOS "
"from Python 3.14 onwards; on those platforms install it with `pip install sonpy`."
)

sonpy = importlib.import_module("sonpy")

Expand Down Expand Up @@ -77,10 +80,10 @@ class CedRawIO(BaseRawIO):

* This IO reads smr and smrx files

* sonpy is installed by the ``ced`` extra, but upstream only publishes wheels for Windows,
and for Linux and macOS from Python 3.14 onwards. Elsewhere the extra resolves to nothing
installable and this class raises an ImportError naming the constraint on first use; the
PyPI source distribution ships a Windows binary and is not usable.
* sonpy is installed by the ``ced`` and ``all`` extras, but upstream only publishes wheels for
Windows, and for Linux and macOS from Python 3.14 onwards. Elsewhere both extras skip sonpy
and this class raises an ImportError naming the constraint on first use; the PyPI source
distribution ships a Windows binary and is not usable.

* Old smr files can be read without sonpy using Spike2RawIO. Only smrx requires this class.

Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ neomatlabio = ["scipy>=1.0.0"]
nixio = ["nixio>=1.5.0"]
tiffio = ["pillow"]
edf = ["pyedflib"]
ced = ["sonpy"]
# sonpy wheels exist only for Windows, and for Linux/macOS from Python 3.14 (same marker as in `test`)
ced = ["sonpy; platform_system=='Windows' or python_version>='3.14'"]
nwb = ["pynwb"]
maxwell = ["h5py"]
biocam = ["h5py"]
Expand All @@ -124,7 +125,7 @@ all = [
"pytest",
"pytest-cov",
"scipy>=1.0.0",
"sonpy",
"sonpy; platform_system=='Windows' or python_version>='3.14'",
"tqdm",
"wenv; sys_platform!='win32'",
"zugbruecke>=0.2; sys_platform!='win32'",
Expand Down
Loading