Skip to content

Commit 8aee545

Browse files
Merge branch 'main' into setup-emscripten-ci
2 parents 6b8d139 + a2bdbe5 commit 8aee545

22 files changed

+239
-186
lines changed

.github/workflows/ci.yaml

Lines changed: 20 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -16,89 +16,55 @@ jobs:
1616
# macos-13 is an intel runner, macos-14 is a arm64 runner
1717
platform: [ubuntu-latest, windows-latest, macos-13, macos-14]
1818

19+
defaults:
20+
run:
21+
shell: bash -el {0}
22+
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
2631
uses: conda-incubator/[email protected]
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+
# TODO: remove --pre option when zarr v3 is out
60+
run: python -m pip install --pre zarr>=3.0.0b2
9061

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

9765
- name: Run tests
9866
shell: "bash -l {0}"
99-
run: |
100-
conda activate env
101-
pytest -v
67+
run: pytest -v
10268

10369
- uses: codecov/codecov-action@v5
10470
with:

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ repos:
1414
- id: debug-statements
1515

1616
- repo: https://github.com/astral-sh/ruff-pre-commit
17-
rev: v0.8.4
17+
rev: v0.9.4
1818
hooks:
1919
- id: ruff
2020
args: ["--fix", "--show-fixes"]
2121
- id: ruff-format
2222

2323
- repo: https://github.com/scientific-python/cookie
24-
rev: 2024.08.19
24+
rev: 2025.01.22
2525
hooks:
2626
- id: sp-repo-review
2727

2828
- repo: https://github.com/pre-commit/mirrors-mypy
29-
rev: v1.14.0
29+
rev: v1.14.1
3030
hooks:
3131
- id: mypy
3232
args: [--config-file, pyproject.toml]
33-
additional_dependencies: [numpy, pytest, crc32c, zfpy, 'zarr>=3.0.0b2']
33+
additional_dependencies: [numpy, pytest, crc32c, zfpy, 'zarr>=3.0.0rc1']

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: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,64 @@ Release notes
1111
Unreleased
1212
----------
1313

14+
1415
.. _unreleased:
1516

1617
Unreleased
1718
----------
1819

20+
Improvements
21+
~~~~~~~~~~~~
22+
* Raise a custom `UnknownCodecError` when trying to retrieve an unavailable codec.
23+
By :user:`Cas Wognum <cwognum>`.
24+
25+
Fixes
26+
~~~~~
27+
* Remove redundant ``id`` from codec metadata serialization in Zarr3 codecs.
28+
By :user:`Norman Rzepka <normanrz>`, :issue:`685`
29+
30+
.. _release_0.15.0:
31+
32+
0.15.0
33+
------
34+
1935
Breaking changes
2036
~~~~~~~~~~~~~~~~
2137
* All arguments to the ``PCodec`` constructor except for ``level``
2238
are now keyword only, to support the updated API.
2339
By :user:`Sam Levang <slevang>`, :issue:`623`
2440

41+
Deprecations
42+
~~~~~~~~~~~~
43+
The following ``blosc`` funcitons are deprecated, with no replacement.
44+
This is because they are not intended to be public API.
45+
46+
- ``numcodecs.blosc.init``
47+
- ``numcodecs.blosc.destroy``
48+
- ``numcodecs.blosc.compname_to_compcode``
49+
- ``numcodecs.blosc.cbuffer_sizes``
50+
- ``numcodecs.blosc.cbuffer_metainfo``
51+
52+
In addition, ``numcodecs.blosc.decompress_partial`` is deprecated as
53+
has always been experimental and there is no equivalent in the official
54+
blsoc Python package.
55+
By :user:`David Stansby <dstansby>`, :issue`619`
2556

2657
Fixes
2758
~~~~~
2859
* Fixes issue with ``Delta`` Zarr 3 codec not working with ``astype``.
2960
By :user:`Norman Rzepka <normanrz>`, :issue:`664`
30-
61+
* Cleanup ``PCodec`` soft dependency.
62+
Previously importing ``numcodecs.pcodec`` would work if ``pcodec`` is not installed,
63+
but now it will fail to import. This mirrors the behaviour of other optional dependencies.
64+
By :user:`John Kirkham <jakirkham>`, :issue:`647`
65+
* Fixes issues with the upcoming ``zarr`` 3.0.0 release.
66+
By :user:`Norman Rzepka <normanrz>`, :issue:`675`
67+
68+
* Removed Version Check: The previous code included a check for the `NumPy` version
69+
and a warning if the version was incompatible with `zfpy`.
70+
This check has been removed because `zfpy` now supports the newer versions of `NumPy`.
71+
By :user:`Meher Gajula <me-her>`, :issue:`672`
3172

3273
Improvements
3374
~~~~~~~~~~~~
@@ -44,6 +85,7 @@ Improvements
4485
are still silently caught.
4586
By :user:`David Stansby <dstansby>`, :issue:`550`.
4687

88+
.. _release_0.14.1:
4789

4890
0.14.1
4991
------

docs/zarr3.rst

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Zarr 3 codecs
55
.. automodule:: numcodecs.zarr3
66

77

8-
Bytes-to-bytes codecs
9-
---------------------
8+
Compressors (bytes-to-bytes codecs)
9+
-----------------------------------
1010
.. autoclass:: Blosc()
1111

1212
.. autoattribute:: codec_name
@@ -40,58 +40,61 @@ Bytes-to-bytes codecs
4040
.. autoattribute:: codec_name
4141

4242

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

4749
.. autoattribute:: codec_name
4850

49-
.. autoclass:: BitRound()
51+
.. autoclass:: CRC32C()
5052

5153
.. autoattribute:: codec_name
5254

53-
.. autoclass:: FixedScaleOffset()
55+
.. autoclass:: Adler32()
5456

5557
.. autoattribute:: codec_name
5658

57-
.. autoclass:: Quantize()
59+
.. autoclass:: Fletcher32()
5860

5961
.. autoattribute:: codec_name
6062

61-
.. autoclass:: PackBits()
63+
.. autoclass:: JenkinsLookup3()
6264

6365
.. autoattribute:: codec_name
6466

65-
.. autoclass:: AsType()
6667

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

72+
.. autoattribute:: codec_name
6973

70-
Bytes-to-bytes checksum codecs
71-
------------------------------
72-
.. autoclass:: CRC32()
74+
.. autoclass:: BitRound()
7375

7476
.. autoattribute:: codec_name
7577

76-
.. autoclass:: CRC32C()
78+
.. autoclass:: FixedScaleOffset()
7779

7880
.. autoattribute:: codec_name
7981

80-
.. autoclass:: Adler32()
82+
.. autoclass:: Quantize()
8183

8284
.. autoattribute:: codec_name
8385

84-
.. autoclass:: Fletcher32()
86+
.. autoclass:: PackBits()
8587

8688
.. autoattribute:: codec_name
8789

88-
.. autoclass:: JenkinsLookup3()
90+
.. autoclass:: AsType()
8991

9092
.. autoattribute:: codec_name
9193

9294

93-
Array-to-bytes codecs
94-
---------------------
95+
96+
Serializers (array-to-bytes codecs)
97+
-----------------------------------
9598
.. autoclass:: PCodec()
9699

97100
.. autoattribute:: codec_name

numcodecs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
ncores = multiprocessing.cpu_count()
5050
except OSError: # pragma: no cover
5151
ncores = 1
52-
blosc.init()
52+
blosc._init()
5353
blosc.set_nthreads(min(8, ncores))
5454
atexit.register(blosc.destroy)
5555

0 commit comments

Comments
 (0)