Skip to content
Merged
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
4 changes: 4 additions & 0 deletions docs/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ Fixes
~~~~~
* Fixes issue with ``Delta`` Zarr 3 codec not working with ``astype``.
By :user:`Norman Rzepka <normanrz>`, :issue:`664`
* Cleanup ``PCodec`` soft dependency.
Previously importing ``numcodecs.pcodec`` would work if ``pcodec`` is not installed,
but now it will fail to import. This mirrors the behaviour of other optional dependencies.
By :user:`John Kirkham <jakirkham>`, :issue:`647`
* Fixes issues with the upcoming ``zarr`` 3.0.0 release.
By :user:`Norman Rzepka <normanrz>`, :issue:`675`

Expand Down
10 changes: 1 addition & 9 deletions numcodecs/pcodec.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@

from numcodecs.abc import Codec
from numcodecs.compat import ensure_contiguous_ndarray

try:
from pcodec import ChunkConfig, DeltaSpec, ModeSpec, PagingSpec, standalone
except ImportError: # pragma: no cover
standalone = None

from pcodec import ChunkConfig, DeltaSpec, ModeSpec, PagingSpec, standalone

DEFAULT_MAX_PAGE_N = 262144

Expand Down Expand Up @@ -58,9 +53,6 @@ def __init__(
delta_encoding_order: int | None = None,
equal_pages_up_to: int = DEFAULT_MAX_PAGE_N,
):
if standalone is None: # pragma: no cover
raise ImportError("pcodec must be installed to use the PCodec codec.")

# note that we use `level` instead of `compression_level` to
# match other codecs
self.level = level
Expand Down
5 changes: 1 addition & 4 deletions numcodecs/tests/test_pcodec.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import numpy as np
import pytest

from numcodecs.pcodec import PCodec

try:
# initializing codec triggers ImportError
PCodec()
from numcodecs.pcodec import PCodec
except ImportError: # pragma: no cover
pytest.skip("pcodec not available", allow_module_level=True)

Expand Down
Loading