Skip to content

Fix transpose codec on dimension-reducing selections#435

Merged
manzt merged 1 commit into
mainfrom
push-vspsykrqwssl
Jun 24, 2026
Merged

Fix transpose codec on dimension-reducing selections#435
manzt merged 1 commit into
mainfrom
push-vspsykrqwssl

Conversation

@manzt

@manzt manzt commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Closes #427

A transpose codec's order is defined over the array's full rank. When a
selection drops dimensions (e.g. integer indexing), the output has lower
rank than the order, so getStrides asserts "Order length must match the
number of dimensions." and the read fails.

Project the native order onto the surviving axes so a dimension-reducing
read keeps the array's native layout instead of throwing. BasicIndexer
now exposes the original axis index of each output dimension, and the
array context's getStrides uses those to remap the order. A full read of
a transposed array and a slice of it now report consistent strides and the
full-rank path is unchanged.

@changeset-bot

changeset-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f11da6f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
zarrita Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@manzt
manzt force-pushed the push-vspsykrqwssl branch from b3d5ed9 to 6b09ed5 Compare June 24, 2026 14:49
Closes #427

A transpose codec's order is defined over the array's full rank. When a
selection drops dimensions (e.g. integer indexing), the output has lower
rank than the order, so getStrides asserts "Order length must match the
number of dimensions." and the read fails — e.g. reading a 2D thumbnail
from a 3D array stored with a transpose codec.

Project the native order onto the surviving axes so a dimension-reducing
read keeps the array's native layout instead of throwing. BasicIndexer
now exposes the original axis index of each output dimension, and the
array context's getStrides uses those to remap the order. A full read of
a transposed array and a slice of it now report consistent strides; the
full-rank path is unchanged.
@manzt
manzt force-pushed the push-vspsykrqwssl branch from 6b09ed5 to f11da6f Compare June 24, 2026 15:15
@manzt
manzt merged commit 152a90b into main Jun 24, 2026
2 checks passed
@manzt
manzt deleted the push-vspsykrqwssl branch June 24, 2026 15:16
@github-actions github-actions Bot mentioned this pull request Jun 24, 2026
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.

bug: zarrita throwing error for zarr data with transpose codec

1 participant