FIX: require zarr>=3 for DataTree.to_zarr compatibility - #399
Merged
Merged
Conversation
syedhamidali
force-pushed
the
fix/zarr-v3-compat
branch
from
August 14, 2026 14:41
19f492b to
886c2cf
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #399 +/- ##
=======================================
Coverage 94.23% 94.23%
=======================================
Files 29 29
Lines 6452 6452
=======================================
Hits 6080 6080
Misses 372 372
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
|
Thanks @syedhamidali, for trying. There is an issue in the writer. Maybe @aladinor has a clue? |
) Current xarray forwards a `zarr_format` argument to `zarr.open_group()`, which `zarr<3` rejects. Bump the pin to `>=3` in requirements_dev.txt, environment.yml and ci/notebooktests.yml. zarr v3 then surfaces a second issue: its codecs cannot serialize numpy MaskedArrays, which xradar's IRIS reader returns for moments such as VRADH. Fill masked entries in the multiple-sweeps-into-volume-scan notebook before `to_zarr`. Verified with real IRIS data (zarr 3.3.0 + xarray 2026.7.0): the to_zarr + open_datatree roundtrip succeeds and VRADH values are preserved (masked -> NaN).
syedhamidali
force-pushed
the
fix/zarr-v3-compat
branch
from
August 14, 2026 15:09
886c2cf to
a9051c2
Compare
kmuehlbauer
approved these changes
Sep 1, 2026
Collaborator
|
Thanks @syedhamidali! This will unlock other PR, which got stuck because of zarr < 3. |
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.
to_zarr()withzarr_formatargument #398history.mdSummary
The
multiple-sweeps-into-volume-scannotebook fails onDataTree.to_zarr(). There are actually two problems, both surfaced by current xarray:zarr<3'sopen_group()rejects thezarr_formatargument that recent xarray forwards →TypeError: open_group() got an unexpected keyword argument 'zarr_format'.zarr>=3, its codecs can't serialize numpyMaskedArray— and xradar's IRIS reader returns masked moments (e.g.VRADH) →ValueError: cannot reshape array of size N into shape (4N,).Fix
>=3(requirements_dev.txt,environment.yml,ci/notebooktests.yml).to_zarr(smallfill_maskedhelper viamap_over_datasets).Verified
With zarr 3.3.0 + xarray 2026.7.0 (the exact combo that fails in CI), on a real IRIS/Sigmet file (which yields a masked
VRADH): theto_zarr+open_datatreeroundtrip succeeds andVRADHvalues are preserved (masked → NaN).Note: I couldn't run the full notebook locally (its data is on the IDEAM
s3-radaresideambucket), but reproduced and fixed the exact failing operation with representative IRIS data.