Skip to content

feat/v3 scale offset cast#3774

Closed
d-v-b wants to merge 9 commits intozarr-developers:mainfrom
d-v-b:feat/v3-scale-offset-cast
Closed

feat/v3 scale offset cast#3774
d-v-b wants to merge 9 commits intozarr-developers:mainfrom
d-v-b:feat/v3-scale-offset-cast

Conversation

@d-v-b
Copy link
Contributor

@d-v-b d-v-b commented Mar 13, 2026

This PR adds scale_offset and cast_value codecs. Used together, these codecs replace the fixedscaleoffset codec defined in numcodecs.

closes #3772

as an experiment, I'm including some developer notes I had claude write in the commit history. We can remove them before merging if we don't want that kind of thing sticking around.

@d-v-b
Copy link
Contributor Author

d-v-b commented Mar 13, 2026

cc @emmaualemalthot

raise ValueError(f"Unknown rounding mode: {mode}")


def _cast_array(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this implementation is inefficient and will probably remain so as long as we are using python for this.

@d-v-b
Copy link
Contributor Author

d-v-b commented Mar 16, 2026

I'm a bit worried that this implementation is a bit too much stuff for zarr-python, and that perhaps this belongs in a separate project that manages the zarr-python compatibility. Thoughts?

@d-v-b d-v-b marked this pull request as ready for review March 17, 2026 11:10
@d-v-b d-v-b requested a review from a team March 17, 2026 11:29
@emmanuelmathot
Copy link

@d-v-b For me it really depends on how we can easily release this PR. How easy is it to release it here and then move to an external package or vice-versa?

@maxrjones
Copy link
Member

maxrjones commented Mar 23, 2026

I'm a bit worried that this implementation is a bit too much stuff for zarr-python, and that perhaps this belongs in a separate project that manages the zarr-python compatibility. Thoughts?

I don't see a lot of value in bundling it in zarr-python, since it seems unlikely that we'd long-term encourage a pure python implementation. I'd recommend a new repository in zarr-developers for easy findability.

@d-v-b
Copy link
Contributor Author

d-v-b commented Mar 24, 2026

@d-v-b For me it really depends on how we can easily release this PR. How easy is it to release it here and then move to an external package or vice-versa?

this PR will not be easy to merge, so I'm going to close it and move this functionality to a separate package at https://github.com/zarr-developers/cast-value.py/

@d-v-b d-v-b closed this Mar 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.

support scale_offset and cast_value codecs

3 participants