Conversation
Each data type's definition declares the JSON shape of its fill value and the rules for one of that shape, and the v3 array validators judge a document's fill value against the data type the scope read. A field that is read keeps the fields it read inside, by location, so a struct judges each field's fill value by that field's own type. Assisted-by: ClaudeCode:claude-opus-5-5
…resolve kept The simplest spelling of a field that read spells each field it holds from its reading in `Resolved.nested`, rather than reading every subtree again at each level. A nested field of a field without problems has none, so the branch for one without a spelling could not be taken. Assisted-by: ClaudeCode:claude-opus-5-5
…see past unknown keys - The JSON check walks one frame per level of nesting, as `refine_json` does, so a fill value checked against a JSON-typed shape reads as deep as `refine_json` reads: a struct fill value 600 levels deep raised `RecursionError`. - The integer, float and complex fill value rules are partial applications of module-level functions, so a scope's definitions pickle again. - A key a fill value's shape does not declare is reported and left out, and the fill value rules still judge the rest, as `judge` does for a configuration. - A struct whose reading holds no reading of a field's type leaves that field's fill value unjudged. - `fill_value_problems` takes the reading of any data type, whatever its configuration's type. - `create_default` says that an overridden `data_type` needs its own `fill_value`. Assisted-by: ClaudeCode:claude-opus-5-5
Assisted-by: ClaudeCode:claude-opus-5-5
A chunk grid's definition says which arrays it fits, and the v3 array validators judge a document's grid against its shape once both are read: a regular grid has a chunk length for each dimension, and 0 only for a dimension of length 0; a rectilinear grid has chunk lengths for each dimension that cover it. Assisted-by: ClaudeCode:claude-opus-5-5
…ength of 1 The grid `create_default` derives from an overridden `shape` had a chunk length of 0 for a dimension of length 0. The regular grid asks for chunk lengths greater than zero, and `zarr` refuses to open such a grid, so the derived grid now has a chunk length of 1 there. It still fits the shape. Assisted-by: ClaudeCode:claude-opus-5-5
Assisted-by: ClaudeCode:claude-opus-5-5
d-v-b
force-pushed
the
feat/zarr-metadata-grid-shape
branch
from
September 28, 2026 07:56
be8ce62 to
e0f0db1
Compare
This was referenced Sep 28, 2026
Closed
Documentation build overview
5 files changed ·
|
d-v-b
marked this pull request as ready for review
September 28, 2026 08:32
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI text below 🤖
The second of four pieces of layer 4, depending on #4440 (4a, fill values): a v3 array's
chunk_gridis judged against itsshape, by the grid's definition. The first four commits are #4440's; this PR's are the last three.What a grid knows.
ChunkGridDefinitiongainsshape_rules(configuration, nested, shape): what the spec disallows in a grid of that configuration over an array of a given shape, located in the configuration. It takes the same arguments as 4a'sfill_value_rules: the configuration, the fields it holds as the scope read them, and the thing judged. A grid that says nothing of the shape fits every one, so a third-party grid is unaffected. The two package grids:chunk_shapesentry per dimension, with chunk lengths that sum to at least the dimension's length (extension). A bare integer repeats until it covers, so it always does. A run-length entry counts as length times count and is never expanded.[]covers a dimension of length 0.Where it is judged.
validate_array_metadata_v3judges the grid once both the grid and the shape are read. A grid the scope did not read, being out of scope or invalid, is left unjudged. So is a grid beside a shape that fails its own check, so no problem is reported twice. The check reachesfrom_json,from_key_value,to_key_value, the pydantic types and each array in an inlineconsolidated_metadata. Reading the shape now has one owner, which returns the lengths orNonewith its problems. The v3 grid anddimension_nameschecks use it, and so does the v2 rank check betweenshapeandchunks.chunk_grid_problemsstays private, inv3._definition. 4c's door returns each axis's chunk lengths along with the problems, and replaces it.Breaking. A document whose grid does not fit its shape now has a problem in
chunk_grid.configuration, where the package accepted it before.create_default(chunk_grid=...)withoutshapekeeps the scalar defaultshape=(), which a grid of another rank does not fit, so that model now fails atto_key_value. The docstring says to pass the two together.A fix on the way.
create_default(shape=...)setchunk_shapeequal toshape, so an empty dimension got a chunk length of 0.zarrrefuses to open that grid: "integer chunk edge length must be >= 1". The default grid now has a chunk length of 1 there, which still fits the shape. This is its own commit, with a bugfix fragment.Choices worth a look
[]for a dimension of length 0 ("has no chunk edges"). This PR accepts it, since there is nothing to cover.create_defaulthas the same derivation:chunksequalsshape, with 0 for an empty dimension.zarropens that document, so this PR leaves it alone.shape_rulesreturns only problems. In 4c the lengths come from a separate function, which is only called on a grid itsshape_rulesaccepted. The design review considered a singlechunks -> (lengths, problems)hook and kept the split, for the same reasonrulesandcanonicalare split: the rules report problems, and derivation works from what they accepted.Reviews. Two, with separate lenses. The correctness review found no bug in the rules. A Hypothesis differential against a reference written from the spec text agreed on 8,000 examples, and its reach was measured: rank mismatches, 0 on an empty dimension, uncovered dimensions, run-length entries, exact cover and
[]for length 0 all came up. Canonical and written rectilinear spellings agreed on 3,000 examples. zarr-python agrees everywhere except[], noted above. The review's one finding was the chunk length of 0 fromcreate_default. The design review's changes are in too:chunk_grid_problemsstays private.no_rules(*_)default serves every hook, instead of one per arity.The stack. Layers 0 (#4420, #4421, #4422), 1 (#4432), 2 (#4434) and 3 (#4436) have merged. 4a is #4440; this is 4b; 4c (#4442) and 4d (#4443) follow.
🤖 Generated with Claude Code