fix: scalar variable manifests get shape () not (1,) from kerchunk refs#965
Merged
TomNicholas merged 1 commit intozarr-developers:mainfrom Apr 13, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #965 +/- ##
=======================================
Coverage 89.30% 89.31%
=======================================
Files 33 33
Lines 2039 2031 -8
=======================================
- Hits 1821 1814 -7
+ Misses 218 217 -1
🚀 New features to boost your workflow:
|
Kerchunk uses v2-style chunk key "0" for scalar variables, which get_chunk_grid_shape interprets as 1D shape (1,) instead of scalar (). Pass the chunk grid shape derived from metadata into ChunkManifest so scalar variables get the correct () shape. Also handle 0-d array indexing in ChunkManifest.__init__. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
c5d14c1 to
d1cd415
Compare
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.
Closes #966
Summary
"0"for scalar variables, whichget_chunk_grid_shapeinterprets as 1D shape(1,)instead of scalar(). This causesManifestStore.get_entryto return an ndarray instead of a string when resolving scalar chunk paths, crashingurlparse.ChunkManifest, so scalar variables get the correct()shape.ChunkManifest.__init__when shape is().Test plan
test_scalar_variable_manifest_shape— verifies scalar variable from kerchunk refs produces manifest withshape_chunk_grid == ()