Preserve zarr version in register command#198
Open
mattersoflight wants to merge 3 commits intomainfrom
Open
Conversation
Add version parameter to create_empty_hcs_zarr() and detect input zarr version in register_cli() to ensure output version matches input (v2→v2, v3→v3). This maintains compatibility with both OME-NGFF v0.4 (zarr v2) and v0.5 (zarr v3) datasets. Changes follow the pattern from waveOrder PR#519: - Add optional version parameter to create_empty_hcs_zarr (default "0.4") - Pass version to open_ome_zarr when creating output plate - Detect input version from source plate in register_cli - Backward compatible: existing calls use default "0.4" Pair-coded-with: Soorya Pradeep <@Soorya19Pradeep> Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Convert shape, scale, and chunks to native Python types for zarr v3 compatibility (zarr v3 requires native Python ints/floats, not numpy types) - Fix position existence checking by using try/except instead of unreliable zgroup membership check - Fix channel appending to apply to all positions, not just the last one Fixes KeyError when accessing positions and TypeError when creating arrays with numpy int64 values in zarr v3 format. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Contributor
|
I have tested the PR on a Hummingbird dataset with the following conditions: |
16b5a89 to
bea47c9
Compare
Contributor
|
I have added the changes to concatenate to the same PR, as this is a very small number of lines of code as well. It was tested on zarr version 3 dataset with multiple positions. |
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.
Add version parameter to create_empty_hcs_zarr() and detect input zarr version in register_cli() to ensure output version matches input (v2→v2, v3→v3). This maintains compatibility with both OME-NGFF v0.4 (zarr v2) and v0.5 (zarr v3) datasets.
Changes follow the pattern from waveOrder PR#519:
Pair-coded-with: Soorya Pradeep <@Soorya19Pradeep>