Uh oh!
There was an error while loading. Please reload this page.
add reshape codec - #82
Conversation
split up functions in reshape to make more readable split up resolveOutputShape
normanrz
left a comment
There was a problem hiding this comment.
Looks good, just a few minor notes.
| "reshape codec received an array of shape " + Arrays.toString(chunkArray.getShape()) | ||
| + " but expected the chunk shape " + Arrays.toString(inputShape) + "."); | ||
| } | ||
| int[] outputShape = resolveOutputShape(inputShape); |
There was a problem hiding this comment.
The outputChunkShape is computed in every encode and decode call. It could be cached as a protected property of the class, because it is only changed when the arrayMetadata changes. You can override the setCoreArrayMetadata metadata, compute the outputChunkShape there, and use the property in encode and decode.
Uh oh!
There was an error while loading. Please reload this page.
| .withDataType(DataType.UINT32) | ||
| .withChunkShape(4, 5, 6, 3) | ||
| .withFillValue(0) | ||
| .withCodecs(c -> c.withReshape(new Object[]{new int[]{0, 1}, new int[]{2}, 3}).withZstd()); |
There was a problem hiding this comment.
Once we landed #81, we should add a test that uses reshape + jpeg. Because reshape does not alter the byte-layout, this test doesn't do much. Still useful, though!
Co-authored-by: Norman Rzepka <code@normanrz.com>
Uh oh!
There was an error while loading. Please reload this page.
Implemented a spec-compliant ReshapeCodec zarr-developers/zarr-extensions#10 in zarr-java plus tests, all passing.