Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement zarr3 support for grib #4

Merged
merged 3 commits into from
Nov 26, 2024

Conversation

moradology
Copy link

This PR updates serialization logic for zarr3 support, updates relevant API usage in grib2.py and combine.py, and updates tests accordingly. xarray-datatree tests have been skipped for now, but a followup PR should re-implement the related behaviors around the new version of xarray which includes xarray.Datatree

@moradology moradology changed the base branch from main to v3 November 21, 2024 21:12
@@ -491,9 +494,9 @@ def second_pass(self):
if f"{v}/.zgroup" in fns:
# recurse into groups - copy meta, add to dirs to process and don't look
# for references in this dir
self.out[f"{v}/.zgroup"] = m[f"{v}/.zgroup"]
self.out[f"{v}/.zgroup"] = m.fs.cat(f"{v}/.zgroup")
Copy link
Owner

Choose a reason for hiding this comment

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

I dont think that this works with zarr 2

@@ -443,8 +446,8 @@ def store_coords(self):
logger.debug("Written coordinates")
for fn in [".zgroup", ".zattrs"]:
# top-level group attributes from first input
if fn in m:
self.out[fn] = ujson.dumps(ujson.loads(m[fn]))
if m.fs.exists(fn):
Copy link
Owner

Choose a reason for hiding this comment

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

Ask the zarr store or dict if this exists rather than hitting the fielsystem directly so it is compatible with zarr python 2

@mpiannucci
Copy link
Owner

Im going to merge this in and then spec out what needs to be done from there back on the main v3 branch i was working on

@mpiannucci mpiannucci merged commit 9444ff8 into mpiannucci:v3 Nov 26, 2024
0 of 4 checks passed
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.

2 participants