Skip to content

Add scale_offset array->array codec - #87

Open
konstibob wants to merge 3 commits into
zarr-developers:mainfrom
konstibob:feat/Scale_Offset_Codec
Open

Add scale_offset array->array codec#87
konstibob wants to merge 3 commits into
zarr-developers:mainfrom
konstibob:feat/Scale_Offset_Codec

Conversation

@konstibob

Copy link
Copy Markdown
Contributor

Implemented the scale_offset array→array codec. Applies (in - offset) * scale on encode / (in / scale) + offset on decode, keeping dtype and shape unchanged.

konstibob and others added 2 commits July 24, 2026 15:55
Implements the zarr-extensions scale_offset codec: encode applies
(in - offset) * scale, decode applies (in / scale) + offset, in the
input data type's arithmetic. Integer arithmetic is exact with a
representability check at each step (out-of-range or non-exact division
is an error); floating-point uses native float/double ops. Supports the
10 real-number data types this library models. The data type is
unchanged; only the fill value is transformed and propagated downstream.

Registered in the v3 CodecRegistry and exposed via
CodecBuilder.withScaleOffset(...). Tests in the new
dev.zarr.zarrjava.codec test package.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@konstibob

Copy link
Copy Markdown
Contributor Author

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.

1 participant