Skip to content

docs(zarr-metadata): document every public object and give struct its reference page - #415

Draft
d-v-b wants to merge 4 commits into
mainfrom
claude/zarr-metadata-api-docs-13ef0c
Draft

d-v-b wants to merge 4 commits into
mainfrom
claude/zarr-metadata-api-docs-13ef0c

Conversation

@d-v-b

@d-v-b d-v-b commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

🤖 AI text below 🤖

Every public object now has an API reference entry with a docstring, and the struct data type has its reference page.

A new test fails when a public object is undocumented or a public module has no page.

What changed

  • Every public module, __all__ name, and member of a public class has a docstring: TypedDict fields, model attributes and methods, the *Update types, the v2 codec parameter and data type configurations, the definition package, the problem fields, the top-level module and __version__. Fields are documented by a string under the field, the style the package already used; the numpy Attributes sections in StructField and the numpy.datetime64/numpy.timedelta64 configurations became per-field docstrings. Spec rules are cited with permalinks pinned to the commits the package already cites; v2 codec parameters (which have no spec) were checked against numcodecs and each module's canonical form.
  • zarr_metadata.v3.data_type.struct was on no page; it is now on the data type page, and the API index renders __version__.
  • tests/test_api_docs.py reads the package through griffe, as mkdocstrings does, and asserts that every public module has a ::: page, every public object has a docstring, and the on-disk v2 .zarray/.zgroup types carry the same field docstrings as their merged counterparts. griffelib joins the test dependency group.

Where the docs and the code disagree (documented, not changed)

  • The package reports must_understand: false on a codec as invalid. The spec forbids it only for data types, chunk grids and chunk key encodings (core/index.rst#L1580-L1581). The codec docstrings state both.
  • ZarrV2LzmaParameters says its parameters are "as the lzma module accepts them", but its types admit values lzma refuses when compressing: format: 0, a preset above 9, a preset with filters, a check other than none under FORMAT_ALONE, FORMAT_RAW without filters. The field docstrings describe what lzma accepts.
  • The v2 delta and fixedscaleoffset parameters admit dtype: "|O", which numcodecs refuses; bitround admits a keepbits above the mantissa width, which numcodecs refuses when encoding.

Checks

Ran locally: ruff, pyright 1.1.414, the test suite on Python 3.11 and 3.14, and mkdocs build --strict.

Merge notes

The branch merges main after zarr-developers#4490 restructured the package. Conflicts were resolved in favor of main's text inside each conflicting hunk; the docstrings those hunks dropped are restored in the commit after the merge.

🤖 Generated with Claude Code

d-v-b added 2 commits October 27, 2026 21:17
… reference page

Every public module, `__all__` name, and member of a public class now
carries the docstring its mkdocstrings page renders: TypedDict fields,
model attributes and methods, the metadata key sets, and the top-level
module and `__version__`. Numpy `Attributes` sections become per-field
docstrings. The `struct` data type, which no page rendered, joins the
data type page.

tests/test_api_docs.py reads the package through griffe, as the pages
do, and fails on an undocumented public object, a public module no page
renders, or a Partial (or on-disk v2) type whose field docstrings drift
from its counterpart's.

Assisted-by: ClaudeCode:claude-opus-5-5
Assisted-by: ClaudeCode:claude-opus-5-5
d-v-b added 2 commits October 28, 2026 21:30
…api-docs-13ef0c

# Conflicts:
#	packages/zarr-metadata/docs/api/index.md
#	packages/zarr-metadata/pyproject.toml
#	packages/zarr-metadata/src/zarr_metadata/__init__.py
#	packages/zarr-metadata/src/zarr_metadata/_json.py
#	packages/zarr-metadata/src/zarr_metadata/_typed_json.py
#	packages/zarr-metadata/src/zarr_metadata/model/_array.py
#	packages/zarr-metadata/src/zarr_metadata/model/_group.py
#	packages/zarr-metadata/src/zarr_metadata/model/_validation.py
#	packages/zarr-metadata/src/zarr_metadata/v2/array.py
#	packages/zarr-metadata/src/zarr_metadata/v2/codec.py
#	packages/zarr-metadata/src/zarr_metadata/v2/group.py
#	packages/zarr-metadata/src/zarr_metadata/v3/_definition.py
#	packages/zarr-metadata/src/zarr_metadata/v3/_registry.py
#	packages/zarr-metadata/src/zarr_metadata/v3/array.py
#	packages/zarr-metadata/src/zarr_metadata/v3/chunk_grid/regular.py
#	packages/zarr-metadata/src/zarr_metadata/v3/codec/blosc.py
#	packages/zarr-metadata/src/zarr_metadata/v3/codec/cast_value.py
#	packages/zarr-metadata/src/zarr_metadata/v3/codec/crc32c.py
#	packages/zarr-metadata/src/zarr_metadata/v3/codec/gzip.py
#	packages/zarr-metadata/src/zarr_metadata/v3/codec/sharding_indexed.py
#	packages/zarr-metadata/src/zarr_metadata/v3/codec/zstd.py
#	packages/zarr-metadata/src/zarr_metadata/v3/data_type/numpy_datetime64.py
#	packages/zarr-metadata/src/zarr_metadata/v3/data_type/numpy_timedelta64.py
#	packages/zarr-metadata/src/zarr_metadata/v3/data_type/struct.py
#	packages/zarr-metadata/src/zarr_metadata/v3/group.py
The merge of main brought the v2 codec and data type modules, the split
model modules, the shared `definition` package and the problem fields
`input` and `ctx`, 142 of whose public objects had no docstring. Each now
has one. The per-field docstrings that conflicting hunks dropped (v3
array fields, codec configurations, `StructField`, the numpy time
configurations) are restored where the field kept its meaning, and the
API index renders `__version__` again.

The mirrored-docstring check follows main's types: the Partial forms are
gone, leaving the on-disk v2 `.zarray` and `.zgroup` types.

Assisted-by: ClaudeCode:claude-opus-5-5

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant