Skip to content

Commit c690446

Browse files
committed
Merge zarr-developers/main into jakirkham/use_mv
2 parents 0c823e2 + 3c933cf commit c690446

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+671
-403
lines changed

.github/workflows/ci.yaml

Lines changed: 23 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -13,94 +13,60 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
python-version: ["3.11", "3.12", "3.13"]
16-
# macos-13 is an intel runner, macos-14 is a arm64 runner
17-
platform: [ubuntu-latest, windows-latest, macos-13, macos-14]
16+
# macos-13 is an intel runner, macos-14 is an arm64 runner
17+
platform: [ubuntu-latest, ubuntu-22.04-arm, windows-latest, macos-13, macos-14]
18+
19+
defaults:
20+
run:
21+
shell: bash -el {0}
1822

1923
steps:
2024
- name: Checkout source
2125
uses: actions/checkout@v4
2226
with:
2327
submodules: recursive
28+
fetch-depth: 0 # required for version resolution
2429

2530
- name: Set up Conda
26-
uses: conda-incubator/[email protected].0
31+
uses: conda-incubator/[email protected].1
2732
with:
28-
channels: conda-forge
29-
miniforge-version: latest
30-
python-version: ${{ matrix.python-version }}
33+
channels: conda-forge
34+
miniforge-version: latest
35+
python-version: ${{ matrix.python-version }}
3136

32-
- name: Show info about `base` environment
33-
shell: "bash -l {0}"
34-
run: |
35-
conda info
36-
conda config --show-sources
37-
conda list --show-channel-urls
38-
39-
- name: Set up `env`
40-
shell: "bash -l {0}"
41-
run: >
42-
conda create -n env
43-
c-compiler cxx-compiler
44-
python=${{matrix.python-version}} wheel pip
37+
- name: Install compilers
38+
run: conda install -y c-compiler cxx-compiler
4539

4640
- name: Install clang
47-
shell: "bash -l {0}"
4841
if: matrix.platform == 'macos-13'
49-
run: |
50-
conda activate env
51-
conda install -y 'clang>=12.0.1,<17'
42+
run: conda install -y 'clang>=12.0.1,<17'
5243

53-
- name: Show info about `env` environment
54-
shell: "bash -l {0}"
44+
- name: Show conda environment info
5545
run: |
56-
conda list --show-channel-urls -n env
46+
conda info
47+
conda config --show-sources
48+
conda list --show-channel-urls
5749
5850
- name: Install numcodecs
59-
shell: "bash -l {0}"
6051
run: |
61-
conda activate env
6252
export DISABLE_NUMCODECS_AVX2=""
63-
# TODO: put back zfpy import when it supports numpy 2.0
64-
python -m pip install -v -e .[test,test_extras,msgpack,crc32c]
65-
66-
- name: Install pcodec
67-
if: matrix.python-version != '3.13'
68-
shell: "bash -l {0}"
69-
run: |
70-
conda activate env
71-
python -m pip install -v ".[pcodec]"
53+
python -m pip install -v -e .[test,test_extras,msgpack,crc32c,pcodec,zfpy]
7254
7355
- name: Install zarr-python
74-
shell: "bash -l {0}"
7556
# Since zarr v3 requires numpy >= 1.25, on Python 3.11 leave it out
7657
# so we can have some tests of our minimum version of numpy (1.24)
7758
if: matrix.python-version != '3.11'
78-
run: |
79-
conda activate env
80-
# TODO: remove --pre option when zarr v3 is out
81-
python -m pip install --pre zarr>=3.0.0b2
82-
83-
# This is used to test with zfpy, which does not yet support numpy 2.0
84-
- name: Install older numpy and zfpy
85-
if: matrix.python-version == '3.11'
86-
shell: "bash -l {0}"
87-
run: |
88-
conda activate env
89-
python -m pip install -v ".[zfpy]"
59+
run: python -m pip install zarr>=3
9060

9161
- name: List installed packages
92-
shell: "bash -l {0}"
93-
run: |
94-
conda activate env
95-
python -m pip list
62+
run: python -m pip list
9663

9764
- name: Run tests
9865
shell: "bash -l {0}"
99-
run: |
100-
conda activate env
101-
pytest -v
66+
run: pytest -v
10267

10368
- uses: codecov/codecov-action@v5
10469
with:
70+
fail_ci_if_error: true
10571
token: ${{ secrets.CODECOV_TOKEN }}
10672
verbose: true

.github/workflows/wheel.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
# macos-13 is an intel runner, macos-14 is a arm64 runner
17-
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
16+
# macos-13 is an intel runner, macos-14 is an arm64 runner
17+
os: [ubuntu-latest, ubuntu-22.04-arm, windows-latest, macos-13, macos-14]
1818
env:
1919
CIBW_TEST_COMMAND: python -c "import numcodecs"
2020
CIBW_BUILD: "cp311-* cp312-* cp313-*"
@@ -26,7 +26,7 @@ jobs:
2626
with:
2727
submodules: true
2828

29-
- uses: pypa/cibuildwheel@v2.21.3
29+
- uses: pypa/cibuildwheel@v2.23.0
3030

3131
- uses: actions/upload-artifact@v4
3232
with:

.pre-commit-config.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
exclude: ^fixture/ # files with trailing whitespaces on purpose
22
ci:
33
autoupdate_commit_msg: "chore: update pre-commit hooks"
4+
autoupdate_schedule: "monthly"
45
autofix_commit_msg: "style: pre-commit fixes"
56
autofix_prs: false
67
default_stages: [pre-commit, pre-push]
7-
default_language_version:
8-
python: python3
98
repos:
109
- repo: https://github.com/pre-commit/pre-commit-hooks
1110
rev: v5.0.0
@@ -15,20 +14,20 @@ repos:
1514
- id: debug-statements
1615

1716
- repo: https://github.com/astral-sh/ruff-pre-commit
18-
rev: v0.7.4
17+
rev: v0.9.9
1918
hooks:
2019
- id: ruff
2120
args: ["--fix", "--show-fixes"]
2221
- id: ruff-format
2322

2423
- repo: https://github.com/scientific-python/cookie
25-
rev: 2024.08.19
24+
rev: 2025.01.22
2625
hooks:
2726
- id: sp-repo-review
2827

2928
- repo: https://github.com/pre-commit/mirrors-mypy
30-
rev: 'v1.13.0'
29+
rev: v1.15.0
3130
hooks:
3231
- id: mypy
3332
args: [--config-file, pyproject.toml]
34-
additional_dependencies: [numpy, pytest, crc32c, zfpy, 'zarr>=3.0.0b2']
33+
additional_dependencies: [numpy, pytest, crc32c, zfpy, 'zarr>=3.0.0rc1']

adhoc/blosc_memleak_check.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import sys
22

3+
import numcodecs
34
import numpy as np
45
from numpy.testing import assert_array_equal
56

6-
import numcodecs
7-
87
codec = numcodecs.Blosc()
98
data = np.arange(int(sys.argv[1]))
109
for _ in range(int(sys.argv[2])):

docs/compression/blosc.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,9 @@ Blosc
1818
Helper functions
1919
----------------
2020

21-
.. autofunction:: init
22-
.. autofunction:: destroy
23-
.. autofunction:: compname_to_compcode
2421
.. autofunction:: list_compressors
2522
.. autofunction:: get_nthreads
2623
.. autofunction:: set_nthreads
27-
.. autofunction:: cbuffer_sizes
2824
.. autofunction:: cbuffer_complib
29-
.. autofunction:: cbuffer_metainfo
3025
.. autofunction:: compress
3126
.. autofunction:: decompress
32-
.. autofunction:: decompress_partial

docs/release.rst

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,93 @@ Release notes
1111
Unreleased
1212
----------
1313

14+
1415
.. _unreleased:
1516

17+
Unreleased
18+
----------
19+
20+
Enhancements
21+
~~~~~~~~~~~~
22+
23+
* Add support for the Linux AArch64 architecture, and bump the minimum
24+
macOS deployment target for x86_64 to 10.13.
25+
By :user:`Agriya Khetarpal <agriyakhetarpal>`, :issue:`288`.
26+
27+
Improvements
28+
~~~~~~~~~~~~
29+
* Raise a custom `UnknownCodecError` when trying to retrieve an unavailable codec.
30+
By :user:`Cas Wognum <cwognum>`.
31+
* Add ``typesize`` argument to ``Blosc`` to allow for buffers that are passed to ``encode``
32+
use that information. zarr v3 currently has its Blosc codec as bytes-to-bytes but does retain
33+
the size information so using it here allows for massive compression ratio gains.
34+
By :user:`Ilan Gold <ilan-gold>`
35+
36+
Fixes
37+
~~~~~
38+
* Remove redundant ``id`` from codec metadata serialization in Zarr3 codecs.
39+
By :user:`Norman Rzepka <normanrz>`, :issue:`685`
40+
41+
.. _release_0.15.0:
42+
43+
0.15.0
44+
------
45+
46+
Breaking changes
47+
~~~~~~~~~~~~~~~~
48+
* All arguments to the ``PCodec`` constructor except for ``level``
49+
are now keyword only, to support the updated API.
50+
By :user:`Sam Levang <slevang>`, :issue:`623`
51+
52+
Deprecations
53+
~~~~~~~~~~~~
54+
The following ``blosc`` functions are deprecated, with no replacement.
55+
This is because they are not intended to be public API.
56+
57+
- ``numcodecs.blosc.init``
58+
- ``numcodecs.blosc.destroy``
59+
- ``numcodecs.blosc.compname_to_compcode``
60+
- ``numcodecs.blosc.cbuffer_sizes``
61+
- ``numcodecs.blosc.cbuffer_metainfo``
62+
63+
In addition, ``numcodecs.blosc.decompress_partial`` is deprecated as
64+
has always been experimental and there is no equivalent in the official
65+
blsoc Python package.
66+
By :user:`David Stansby <dstansby>`, :issue`619`
67+
68+
Fixes
69+
~~~~~
70+
* Fixes issue with ``Delta`` Zarr 3 codec not working with ``astype``.
71+
By :user:`Norman Rzepka <normanrz>`, :issue:`664`
72+
* Cleanup ``PCodec`` soft dependency.
73+
Previously importing ``numcodecs.pcodec`` would work if ``pcodec`` is not installed,
74+
but now it will fail to import. This mirrors the behaviour of other optional dependencies.
75+
By :user:`John Kirkham <jakirkham>`, :issue:`647`
76+
* Fixes issues with the upcoming ``zarr`` 3.0.0 release.
77+
By :user:`Norman Rzepka <normanrz>`, :issue:`675`
78+
79+
* Removed Version Check: The previous code included a check for the `NumPy` version
80+
and a warning if the version was incompatible with `zfpy`.
81+
This check has been removed because `zfpy` now supports the newer versions of `NumPy`.
82+
By :user:`Meher Gajula <me-her>`, :issue:`672`
83+
84+
Improvements
85+
~~~~~~~~~~~~
86+
* Add support for ``pcodec`` 0.3. This exposes the new ``delta_spec``
87+
and ``paging_spec`` arguments, but maintains full backwards
88+
compatibility for data written with older package versions.
89+
By :user:`Sam Levang <slevang>`, :issue:`623`
90+
* If an import error is raised when trying to define a codec that is *not*
91+
an optional dependency, it is no longer silently caught. Instead it will
92+
be propagated to the user, as this indicates an issue with the installed
93+
package.
94+
95+
Import errors caused by optional dependencies (ZFPY, MsgPack, CRC32C, and PCodec)
96+
are still silently caught.
97+
By :user:`David Stansby <dstansby>`, :issue:`550`.
98+
99+
.. _release_0.14.1:
100+
16101
0.14.1
17102
------
18103

docs/zarr3.rst

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
.. _Zarr 3 codecs:
2+
13
Zarr 3 codecs
24
=============
35
.. automodule:: numcodecs.zarr3
46

57

6-
Bytes-to-bytes codecs
7-
---------------------
8+
Compressors (bytes-to-bytes codecs)
9+
-----------------------------------
810
.. autoclass:: Blosc()
911

1012
.. autoattribute:: codec_name
@@ -38,58 +40,61 @@ Bytes-to-bytes codecs
3840
.. autoattribute:: codec_name
3941

4042

41-
Array-to-array codecs
42-
---------------------
43-
.. autoclass:: Delta()
43+
Checksum codecs (bytes-to-bytes codecs)
44+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
45+
Need to be used as ``compressors`` in zarr-python.
46+
47+
.. autoclass:: CRC32()
4448

4549
.. autoattribute:: codec_name
4650

47-
.. autoclass:: BitRound()
51+
.. autoclass:: CRC32C()
4852

4953
.. autoattribute:: codec_name
5054

51-
.. autoclass:: FixedScaleOffset()
55+
.. autoclass:: Adler32()
5256

5357
.. autoattribute:: codec_name
5458

55-
.. autoclass:: Quantize()
59+
.. autoclass:: Fletcher32()
5660

5761
.. autoattribute:: codec_name
5862

59-
.. autoclass:: PackBits()
63+
.. autoclass:: JenkinsLookup3()
6064

6165
.. autoattribute:: codec_name
6266

63-
.. autoclass:: AsType()
6467

65-
.. autoattribute:: codec_name
68+
Filters (array-to-array codecs)
69+
-------------------------------
70+
.. autoclass:: Delta()
6671

72+
.. autoattribute:: codec_name
6773

68-
Bytes-to-bytes checksum codecs
69-
------------------------------
70-
.. autoclass:: CRC32()
74+
.. autoclass:: BitRound()
7175

7276
.. autoattribute:: codec_name
7377

74-
.. autoclass:: CRC32C()
78+
.. autoclass:: FixedScaleOffset()
7579

7680
.. autoattribute:: codec_name
7781

78-
.. autoclass:: Adler32()
82+
.. autoclass:: Quantize()
7983

8084
.. autoattribute:: codec_name
8185

82-
.. autoclass:: Fletcher32()
86+
.. autoclass:: PackBits()
8387

8488
.. autoattribute:: codec_name
8589

86-
.. autoclass:: JenkinsLookup3()
90+
.. autoclass:: AsType()
8791

8892
.. autoattribute:: codec_name
8993

9094

91-
Array-to-bytes codecs
92-
---------------------
95+
96+
Serializers (array-to-bytes codecs)
97+
-----------------------------------
9398
.. autoclass:: PCodec()
9499

95100
.. autoattribute:: codec_name

0 commit comments

Comments
 (0)