Skip to content

Remove array-level spatial:bbox from with_transform fixture#17

Draft
wietzesuijker wants to merge 1 commit into
zarr-developers:mainfrom
wietzesuijker:fix/remove-array-level-spatial-bbox
Draft

Remove array-level spatial:bbox from with_transform fixture#17
wietzesuijker wants to merge 1 commit into
zarr-developers:mainfrom
wietzesuijker:fix/remove-array-level-spatial-bbox

Conversation

@wietzesuijker
Copy link
Copy Markdown

@wietzesuijker wietzesuijker commented May 20, 2026

Summary

  • Removes the array-level spatial:bbox line from tests/_test_data/spatial_examples/with_transform.json. The fixture pairs spatial:bbox with spatial:transform on the same array; that dual-source pattern is being disallowed by the convention.
  • spatial:transform + spatial:shape remain authoritative. The bbox is fully derivable as the axis-aligned min/max over the four transformed grid corners.

Companion to the RFC at zarr-conventions/spatial#32 and the spec PR at zarr-conventions/spatial#31.

Why

Floating-point divergence between a stored bbox and a stored transform creates an ambiguity the spec can't adjudicate (zarr-conventions/spatial#6). The new rule is: affine arrays carry spatial:transform, not spatial:bbox. This fixture is one of two example files in the GeoZarr ecosystem that demonstrates the now-forbidden pattern.

Test plan

  • test_spatial_from_fixture in tests/test_conventions/test_spatial.py parametrizes over all spatial_examples/*.json and asserts only on dimensions. The change is safe under the existing suite.
  • No other test file references this fixture by name.
  • Reviewer to run pytest tests/test_conventions/test_spatial.py -v locally.

Follow-up

The Spatial pydantic model in src/geozarr_toolkit/conventions/spatial.py still permits spatial:bbox alongside spatial:transform at the array level. Tightening the model to enforce the new rule is a separate change, naturally sequenced after the upstream spec PR merges.

The example pairs spatial:transform with spatial:bbox at the array level.
That dual-source pattern is the subject of the RFC at
https://github.com/zarr-conventions/spatial/issues/<issue#> — bbox is
fully derivable from transform + shape via the four transformed grid
corners, and storing both means storing the same fact twice (subject to
floating-point divergence).

Drop the redundant bbox line; transform + shape remain authoritative.
The test_spatial_from_fixture test asserts only on dimensions and is
unaffected.
@netlify
Copy link
Copy Markdown

netlify Bot commented May 20, 2026

Deploy Preview for geozarrdemonstration4e8c9 canceled.

Name Link
🔨 Latest commit 1eb4340
🔍 Latest deploy log https://app.netlify.com/projects/geozarrdemonstration4e8c9/deploys/6a0dd60eae453b00081cfae2

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