Repository navigation
Write zarr v3 arrays of strings with HDF5IO and wrap zarr v3 arrays with H5DataIO - #1618
Open
h-mayorquin wants to merge 1 commit into
Open
h-mayorquin wants to merge 1 commit into
h-mayorquin wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1618 +/- ##
=======================================
Coverage 93.17% 93.17%
=======================================
Files 41 41
Lines 10304 10307 +3
Branches 2132 2133 +1
=======================================
+ Hits 9601 9604 +3
Misses 423 423
Partials 280 280 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Nov 18, 2026
This branch has not been deployed
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.
Motivation
This PR solves two things that fail when writing zarr v3 arrays to HDF5:
HDF5IO.get_typeinfers the type of a dataset from its first element, and zarr v3 returns a 0-d array fromdata[0]where zarr v2 returned a scalar. For strings, bytes and objects that 0-d array has an unsized numpy type (np.str_,np.bytes_,np.object_orstr) that h5py cannot create a dataset from.get_typenow uses the Python value the array holds, so these arrays getH5_TEXTorH5_BINARYas with zarr v2. Numeric 0-d arrays keep their numpy type.H5DataIOrejected zarr v3 arrays because they are notIterableanymore. Itsdatanow accepts thearray_datatypes, which includezarr.Array, asDataIOalready does.Both are necessary for the zarr version 3 support across the ecosystem, and in particular to move the
zarrextra to zarr v3, which I will open next. The test ofget_typeuses plain numpy 0-d arrays and fails without the fix in any environment. The test ofH5DataIOonly fails without the fix on zarr v3, so it is a regression test for when the extra moves.How to test the behavior?
Tests included
Checklist
CHANGELOG.mdwith your changes?