Skip to content

Numcodecs in v3 #3037

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

brokkoli71
Copy link
Member

@brokkoli71 brokkoli71 commented May 6, 2025

Implements numcodec_to_zarr3_codec to enable numcodec support in zarr v3 arrays
This PR is a result of moving the to_zarr3 logic from zarr-developers/numcodecs#741 to zarr-python

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 May 6, 2025
@d-v-b
Copy link
Contributor

d-v-b commented May 6, 2025

it might be useful to have a conversation about the strategy here. It looks like numcodecs_to_zarr_v3_codec dynamically creates new classes. My preference would be to avoid any dynamically created classes, since this makes the codebase harder to document / reason about, and can lead to very confusing bugs. I think it's easier in the long term if we explicitly define each codec.

@brokkoli71
Copy link
Member Author

@d-v-b Are you thinking of something like https://github.com/zarr-developers/numcodecs/blob/main/numcodecs/zarr3.py or even moving all the logic from this file to zarr-python?

@d-v-b
Copy link
Contributor

d-v-b commented May 6, 2025

@d-v-b Are you thinking of something like https://github.com/zarr-developers/numcodecs/blob/main/numcodecs/zarr3.py or even moving all the logic from this file to zarr-python?

the file you linked also contains dynamic class generation, which was problematic and motivated this PR: zarr-developers/numcodecs#745, which removes the dynamism.

and yes I think that all of this stuff should live in zarr-python.

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.

TypeError when passing old numcodecs to zarr v3
2 participants