| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
A constant's name is now a purely syntactic transformation of the name of the `Literal` type it manifests, so the format version comes first and is spelled `ZARR_V2`/`ZARR_V3`, matching the `ZarrV2`/`ZarrV3` prefix already used by type names. This replaces the 0.4.0 split under which types put the version first and constants put it last; there is now one rule instead of two. Nine constants are renamed without aliases (pre-1.0). Digit runs stay glued to the token they follow, which keeps the spec vocabulary intact: `Uint8DataTypeName` pairs with `UINT8_DATA_TYPE_NAME`, not `UINT_8_...`, and `Crc32cCodecName` with `CRC32C_CODEC_NAME`. No dtype, codec, chunk-grid, or chunk-key-encoding constant changed name. A strict letter/digit split would have renamed 18 of them for the worse. Store keys also move to the modules describing the documents they name. They are facts about the on-disk specs, so they belong beside the types they key: `ZARR_V2_ATTRIBUTES_STORE_KEY` now lives in `v2/attributes.py` next to `ZarrV2ZAttrsJSON`, rather than in the array model. This keeps the `v2`/`v3` packages as leaf spec-description modules that never import from `model`, and drops the `_group.py` -> `_array.py` import of a key that was never array-specific. `zarr_metadata.model` re-exports all of them, and they are now also exported from the top-level namespace alongside the rest of the spec vocabulary. `CONSOLIDATED_METADATA_KEY_V3` is renamed and moved likewise, but is not a store key: v3 consolidated metadata is embedded as an extension field in the group's own `zarr.json`, so it has no paired `Literal` alias and is not passed to the store-json helpers. Three tests pin what the refactor made implicit: constant names are derived from their types mechanically, the two v3 node store keys still name the same file now that they live in different modules, and the set of value-ambiguous constants the derivation check cannot see is counted so its coverage cannot shrink unnoticed. Assisted-by: ClaudeCode:claude-opus-4.8
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #4232 +/- ##
=======================================
Coverage 93.99% 93.99%
=======================================
Files 91 91
Lines 12795 12795
=======================================
Hits 12027 12027
Misses 768 768
|
Sorry, something went wrong.
Consume the pending news fragments — zarr-developers#4232's constant-naming-grammar removal note, zarr-developers#4264's note widening `JSONValue`'s array arm to the covariant `Sequence`, and zarr-developers#4248's sdist allowlist — into CHANGELOG.md via towncrier for the zarr_metadata-v0.5.0 release. Minor, not patch: the `JSONValue` widening changes a published type's meaning for every consumer that annotates against it, and zarr-developers#4232 removes the old version-last constant spellings outright. Assisted-by: ClaudeCode:claude-opus-5
* chore(zarr-metadata): note the sdist allowlist, and let misc entries speak #4248 gave this package's sdist an explicit allowlist and merged without a news fragment, so a user-visible packaging change was about to miss the 0.5.0 notes. Add one. Filing it as `misc` exposed that towncrier's built-in `misc` type sets `showcontent = false`: the entry would render as a bare PR link, which tells a reader nothing. Restate all five types the `changes/README.md` menu offers — declaring any type replaces the built-in set — as the defaults verbatim except for `misc`, which now shows its content. A change worth a release note is worth a sentence, whatever its category. Assisted-by: ClaudeCode:claude-opus-5 * chore(zarr-metadata): build 0.5.0 changelog Consume the pending news fragments — #4232's constant-naming-grammar removal note, #4264's note widening `JSONValue`'s array arm to the covariant `Sequence`, and #4248's sdist allowlist — into CHANGELOG.md via towncrier for the zarr_metadata-v0.5.0 release. Minor, not patch: the `JSONValue` widening changes a published type's meaning for every consumer that annotates against it, and #4232 removes the old version-last constant spellings outright. Assisted-by: ClaudeCode:claude-opus-5
| Back | FazBrowse Home | New Git URL |
Summary
This PR renames some constant strings in zarr-metadata to use the same grammar as their types. E.g., ARRAY_METADATA_STORE_KEY_V2 → ZARR_V2_ARRAY_METADATA_STORE_KEY. This PR also ensures that these constants are top-level exports.
A full claude-authored PR description can be found at d-v-b#275
Impact assessment
Low -- zarr-metadata is pre-1.0, and the known consumer (zarrista) is not using the constants affected by this PR. With that in mind I don't expect this PR to get reviewed, and I will self-merge in a day or so. Of course review is always welcome, but time is short.
Author attestation
TODO