Skip to content

ZEP 12: bounds as an alternative to shape, origin on the regular grid - #400

Draft
rhoadesScholar wants to merge 5 commits into
zarr-developers:mainfrom
rhoadesScholar:zep-0012-array-bounds
Draft

rhoadesScholar wants to merge 5 commits into
zarr-developers:mainfrom
rhoadesScholar:zep-0012-array-bounds

Conversation

@rhoadesScholar

Copy link
Copy Markdown

Spec text for ZEP 12 (zarr-developers/zeps#72): explicit array bounds. Discussion: zarr-developers/zarr-extensions#79.

  • Core: bounds as an alternative to shape (exactly one present), the derived shape, a worked example with negative chunk keys, a note under resizing, a 3.2 change log entry.
  • Regular chunk grid (1.1): optional origin, permitted only with bounds; negative grid indices; the grid extent and element formulas in terms of the origin; the first chunk may be partial as the last already may be.
  • default and v2 chunk key encodings (1.1): a negative index is written with a leading -; -0 is never written and is rejected on parse; a note on key ordering.

sphinx -W passes except for the two pre-existing storage_transformers duplicate-target errors that main has too.

Array metadata may give `bounds` (a half-open coordinate range per
dimension) in place of `shape`; the regular chunk grid gains an optional
`origin`, permitted only with `bounds`, and grid indices may be negative.
The default and v2 chunk key encodings write a negative index with a
leading `-` and reject `-0`.
Core: version 3.2 and ZEP0012 in the header to match the change log and
the sub-specifications; the `shape` entry points at `bounds` instead of
restating the exactly-one rule; writers omit `origin` when they revert
to `shape`; the example no longer carries a zero `origin`; link the two
remaining uses of "bounds" to its definition.

Regular grid: `origin` MUST NOT be present without `bounds` and readers
MUST refuse `shape` with `origin`; the fill-value recommendation for
positions outside the bounds moves from the note into the body as a
SHOULD; "position" for the within-chunk offset throughout; the example
table's column is the array extent and notes both overhangs.

v2 encoding: the key-ordering note the default encoding already has.
Regular grid: a version 1.0 implementation may accept and ignore
`origin` rather than being said to always do so; "position" in the
shape worked example too. Core: reword the Mandatory lead-in so the
exactly-one rule reads as a sentence.
Follows the ZEP text (zeps#72 review): the two arrays have the same
length and inclusive_min[i] <= exclusive_max[i]; the zero-dimensional
form is given. Examples and the regular grid's resizing text updated.
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