Remove array-level spatial:bbox from with_transform fixture#17
Draft
wietzesuijker wants to merge 1 commit into
Draft
Remove array-level spatial:bbox from with_transform fixture#17wietzesuijker wants to merge 1 commit into
wietzesuijker wants to merge 1 commit into
Conversation
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.
✅ Deploy Preview for geozarrdemonstration4e8c9 canceled.
|
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.
Summary
spatial:bboxline fromtests/_test_data/spatial_examples/with_transform.json. The fixture pairsspatial:bboxwithspatial:transformon the same array; that dual-source pattern is being disallowed by the convention.spatial:transform+spatial:shaperemain 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, notspatial:bbox. This fixture is one of two example files in the GeoZarr ecosystem that demonstrates the now-forbidden pattern.Test plan
test_spatial_from_fixtureintests/test_conventions/test_spatial.pyparametrizes over allspatial_examples/*.jsonand asserts only ondimensions. The change is safe under the existing suite.pytest tests/test_conventions/test_spatial.py -vlocally.Follow-up
The
Spatialpydantic model insrc/geozarr_toolkit/conventions/spatial.pystill permitsspatial:bboxalongsidespatial:transformat the array level. Tightening the model to enforce the new rule is a separate change, naturally sequenced after the upstream spec PR merges.