Skip to content

Latest commit

 

History

History
50 lines (35 loc) · 1.55 KB

File metadata and controls

50 lines (35 loc) · 1.55 KB

About

This repo contains a Python implementation for the cast_value codec for Zarr V3. The spec for that codec is here. The relevant section of the Zarr V3 spec is here. Be advised that the Zarr V3 spec describes an API but that API is NOT NORMATIVE and should be ignored as needed.

Design

  • Use a functional, declarative style with simple data structures and functions that transform them.
  • TypedDicts are preferred over classes.
  • Functions are preferred over methods.
  • Accurate type annotations for everything.
  • Never use the Any type. Always look for a more accurate alternative, like object.

Architecture

This repo has two main parts:

  1. One or more implementations of the cast_value codec. This follows an internal API defined in this library.
  2. One or more implementations of a Codec class compatible with the Zarr-Python codec API. The Zarr-Python codec API is likely to change in the future so the Zarr-Python compatibility layer needs to be robustly versioned.

Tests

  • Every parameter of every function must have a test.
  • Use @pytest.mark.parametrize over pytest classes.
  • Every test must have a docstring that explains what it tests.

Actions

Run Python script

uv run <script>

Setup test env

uv sync --group test

Run tests

uv run pytest tests