Skip to content

Commit e4dac91

Browse files
authored
Merge branch 'main' into main
2 parents e08d083 + 7ed1ace commit e4dac91

File tree

4 files changed

+12
-22
lines changed

4 files changed

+12
-22
lines changed

docs/release.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ Release notes
1111
Unreleased
1212
----------
1313

14-
.. _unreleased:
14+
.. _release_0.15.0:
1515

16-
Unreleased
17-
----------
16+
0.15.0
17+
------
1818

1919
Breaking changes
2020
~~~~~~~~~~~~~~~~
@@ -36,11 +36,16 @@ This is because they are not intended to be public API.
3636
In addition, ``numcodecs.blosc.decompress_partial`` is deprecated as
3737
has always been experimental and there is no equivalent in the official
3838
blsoc Python package.
39+
By :user:`David Stansby <dstansby>`, :issue`619`
3940

4041
Fixes
4142
~~~~~
4243
* Fixes issue with ``Delta`` Zarr 3 codec not working with ``astype``.
4344
By :user:`Norman Rzepka <normanrz>`, :issue:`664`
45+
* Cleanup ``PCodec`` soft dependency.
46+
Previously importing ``numcodecs.pcodec`` would work if ``pcodec`` is not installed,
47+
but now it will fail to import. This mirrors the behaviour of other optional dependencies.
48+
By :user:`John Kirkham <jakirkham>`, :issue:`647`
4449
* Fixes issues with the upcoming ``zarr`` 3.0.0 release.
4550
By :user:`Norman Rzepka <normanrz>`, :issue:`675`
4651

@@ -66,6 +71,7 @@ Improvements
6671
* Raise a custom `UnknownCodecError` when trying to retrieve an unavailable codec.
6772
By :user:`Cas Wognum <cwognum>`.
6873

74+
.. _release_0.14.1:
6975

7076
0.14.1
7177
------

numcodecs/delta.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,7 @@ def encode(self, buf):
6363
enc[0] = arr[0]
6464

6565
# compute differences
66-
# using np.subtract for in-place operations
67-
if arr.dtype == bool:
68-
np.not_equal(arr[1:], arr[:-1], out=enc[1:])
69-
else:
70-
np.subtract(arr[1:], arr[:-1], out=enc[1:])
71-
66+
enc[1:] = np.diff(arr)
7267
return enc
7368

7469
def decode(self, buf, out=None):

numcodecs/pcodec.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@
22

33
from numcodecs.abc import Codec
44
from numcodecs.compat import ensure_contiguous_ndarray
5-
6-
try:
7-
from pcodec import ChunkConfig, DeltaSpec, ModeSpec, PagingSpec, standalone
8-
except ImportError: # pragma: no cover
9-
standalone = None
10-
5+
from pcodec import ChunkConfig, DeltaSpec, ModeSpec, PagingSpec, standalone
116

127
DEFAULT_MAX_PAGE_N = 262144
138

@@ -58,9 +53,6 @@ def __init__(
5853
delta_encoding_order: int | None = None,
5954
equal_pages_up_to: int = DEFAULT_MAX_PAGE_N,
6055
):
61-
if standalone is None: # pragma: no cover
62-
raise ImportError("pcodec must be installed to use the PCodec codec.")
63-
6456
# note that we use `level` instead of `compression_level` to
6557
# match other codecs
6658
self.level = level

numcodecs/tests/test_pcodec.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import numpy as np
22
import pytest
33

4-
from numcodecs.pcodec import PCodec
5-
64
try:
7-
# initializing codec triggers ImportError
8-
PCodec()
5+
from numcodecs.pcodec import PCodec
96
except ImportError: # pragma: no cover
107
pytest.skip("pcodec not available", allow_module_level=True)
118

0 commit comments

Comments
 (0)