Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
17 changes: 15 additions & 2 deletions numcodecs/zfpy.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
from contextlib import suppress
import warnings
import numpy as np

_zfpy = None
with suppress(ImportError):
import zfpy as _zfpy

# Check NumPy version
numpy_version = np.__version__
numpy_version_tuple = tuple(map(int, numpy_version.split('.')))
if numpy_version_tuple >= (2, 0, 0):
_zfpy = None
warnings.warn(
"NumPy version >= 2.0.0 detected. The zfpy library is incompatible with this version of NumPy. "
"Please downgrade to NumPy < 2.0.0 or wait for an update from zfpy.",
UserWarning
)
else:
with suppress(ImportError):
import zfpy as _zfpy

if _zfpy:
from .abc import Codec
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ msgpack = [
]
zfpy = [
"zfpy>=1.0.0",
"numpy<2.0.0",
]
pcodec = [
"pcodec>=0.1.0",
Expand Down