Encode F-contiguous arrays in logical order - #863
Open
ceedot-rock wants to merge 1 commit into
Open
ceedot-rock wants to merge 1 commit into
ceedot-rock wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #863 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 27 27
Lines 905 904 -1
=========================================
- Hits 905 904 -1
🚀 New features to boost your workflow:
|
ceedot-rock
force-pushed
the
fix-850-f-order-logical
branch
from
September 25, 2026 18:41
3ccf9f4 to
f484c82
Compare
Author
|
@alimanfoo this one's ready for review when you have a chance — fixes the F-order encode path from #850. |
A few codecs were walking Fortran-layout arrays in memory order, so the encoded bytes didn’t match the logical data. Encode now flattens in C order; decode reads the stream that way too. Also notes the change under Unreleased in docs/release.md. Fixes zarr-developers#850.
ceedot-rock
force-pushed
the
fix-850-f-order-logical
branch
from
October 4, 2026 15:27
f484c82 to
b85aaa4
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.
Fixes #850.
A few codecs were writing Fortran-order arrays in memory order instead of logical order (vlen, delta, fixedscaleoffset, packbits, categorize). What landed on the wire didn't match the array you thought you had, and decode either failed or gave the wrong answer.
Changes:
np.ascontiguousarray(...).reshape(-1)so the stream follows logical orderndarray_copy(..., order='C'))out=was getting thrown awayIf you already encoded F-order arrays with an affected codec, those old bytes may not round-trip the same way after this. New encodes are consistent.
Happy to adjust naming or tests if you'd rather a different approach.
Slid Phi Labs accepts donations to keep the lab independent.