Skip to content

fix for failing numcodecs.zarr3 codecs #3326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

terraputix
Copy link

@terraputix terraputix commented Aug 3, 2025

Closes #2900.

I did not add a unit test because it was already mentioned in #2900 that all numcodecs should be better tested in CI, but I guess that belongs into another PR.

You can verify that it works by running the following script:

#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.12"
# dependencies = [
#     # "zarr==3.0.2,<3.0.3", # WORKS
#     # "zarr==3.0.4", # FAILS
#     "zarr@git+https://github.com/terraputix/zarr-python.git@8f40aaf3f3fa1d23918520018c60dd0034997f76",  # WORKS
#     "numcodecs==0.15.0",
#     "zfpy==1.0.1",
#     "pcodec==0.3.2",
# ]
# ///
#


import numpy as np
import zarr
zarr.__version__ = "3.0.2"
from numcodecs.zarr3 import ZFPY, PCodec

for serializer in [
    ZFPY(mode=4, tolerance=0.01),
    PCodec(level=8, mode_spec="auto"),
]:
    array = zarr.create_array(
        store=zarr.storage.LocalStore("test"),
        shape=[2, 2],
        chunks=[2, 1],
        dtype=np.float32,
        serializer=serializer,
        compressors=None,
        overwrite=True,
    )
    array[...] = np.array([[0, 1], [2, 3]])

TODO:

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/user-guide/*.rst
  • Changes documented as a new file in changes/
  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

@github-actions github-actions bot added the needs release notes Automatically applied to PRs which haven't added release notes label Aug 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs release notes Automatically applied to PRs which haven't added release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some numcodecs.zarr3 codecs fail with 3.0.4+
1 participant