Skip to content

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

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

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 November 2, 2026 08:54
Add a docstring to every public object, and a test that fails on an
undocumented public object, a public module with no reference page, or a
v2 on-disk field docstring that drifts from its in-memory counterpart.

Assisted-by: ClaudeCode:claude-opus-5-5
…t pass

Cover the vlen codecs, the fixed-width string data types and the strategy
records, and render zarr_metadata.testing, which has no __all__.

Assisted-by: ClaudeCode:claude-opus-5-5
d-v-b added 2 commits November 2, 2026 09:01
Drop the struct sentence, since main already renders that page.

Assisted-by: ClaudeCode:claude-opus-5-5
# Conflicts:
#	packages/zarr-metadata/src/zarr_metadata/model/_array_v3.py
#	packages/zarr-metadata/src/zarr_metadata/v2/_definition.py
#	packages/zarr-metadata/src/zarr_metadata/v3/_definition.py
#	packages/zarr-metadata/src/zarr_metadata/v3/array.py
#	packages/zarr-metadata/src/zarr_metadata/v3/codec/cast_value.py
#	packages/zarr-metadata/src/zarr_metadata/v3/codec/sharding_indexed.py
#	packages/zarr-metadata/src/zarr_metadata/v3/data_type/struct.py
@d-v-b

d-v-b commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

🤖 AI text below 🤖

Superseded by zarr-developers#4590, which merged this branch upstream. The diff against main is now empty.

@d-v-b d-v-b closed this Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant