Skip to content

Commit

Permalink
revert import changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rabernat committed Feb 21, 2024
1 parent 2650be8 commit e81004d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
5 changes: 3 additions & 2 deletions numcodecs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,6 @@
from numcodecs.fletcher32 import Fletcher32
register_codec(Fletcher32)

from numcodecs.pcodec import PCodec
register_codec(PCodec)
with suppress(ImportError):
from numcodecs.pcodec import PCodec
register_codec(PCodec)
8 changes: 1 addition & 7 deletions numcodecs/pcodec.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
import numcodecs.abc
from numcodecs.compat import ensure_contiguous_ndarray

try:
import pcodec
except ImportError:
pcodec = None
import pcodec


class PCodec(numcodecs.abc.Codec):
Expand Down Expand Up @@ -51,9 +48,6 @@ def __init__(
float_mult_spec: Literal["enabled", "disabled"] = "enabled",
max_page_n: int = 262144,
):
if pcodec is None:
raise ImportError("pcodec is not available. Please install the pcodec package.")

# note that we use `level` instead of `compression_level` to
# match other codecs
self.level = level
Expand Down

0 comments on commit e81004d

Please sign in to comment.