Skip to content

Commit

Permalink
revert accidental icechunk commit
Browse files Browse the repository at this point in the history
  • Loading branch information
norlandrhagen committed Jan 29, 2025
1 parent 5d91679 commit 5084adf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
2 changes: 1 addition & 1 deletion ci/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ dependencies:
- dask
- pip
- pip:
- git+https://github.com/zarr-developers/zarr-python # installing from source until >= 3.0.2
- icechunk>=0.1.0a15
- git+https://github.com/zarr-developers/zarr-python # installing from source until >= 3.0.2
- imagecodecs-numcodecs==2024.6.1
20 changes: 4 additions & 16 deletions virtualizarr/writers/icechunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def dataset_to_icechunk(
group_object.update_attributes(
{k: encode_zarr_attr_value(v) for k, v in ds.attrs.items()}
)

return write_variables_to_icechunk_group(
ds.variables,
ds.attrs,
Expand Down Expand Up @@ -141,7 +142,6 @@ def write_variables_to_icechunk_group(
# will overwrite the root group's attributes with the dataset's attributes. We take advantage
# of xarrays zarr integration to ignore having to format the attributes ourselves.
ds = Dataset(loadable_variables, attrs=attrs)

ds.to_zarr(
store,
group=group.name,
Expand Down Expand Up @@ -243,28 +243,16 @@ def write_virtual_variable_to_icechunk(
else:
append_axis = None
# create array if it doesn't already exist
# import ipdb; ipdb.set_trace()
# https://github.com/zarr-developers/zarr-python/blob/458299857141a5470ba3956d8a1607f52ac33857/src/zarr/core/group.py#L1004

arr = group.require_array(
name=name,
shape=zarray.shape,
chunks=zarray.chunks,
chunk_shape=zarray.chunks,
dtype=encode_dtype(zarray.dtype),
# filters=zarray._v3_codec_pipeline()[0],
codecs=zarray._v3_codec_pipeline(),
dimension_names=var.dims,
fill_value=zarray.fill_value,
)
# import ipdb; ipdb.set_trace()

# arr = group.require_array(
# name=name,
# shape=zarray.shape,
# chunks=zarray.chunks,
# dtype=encode_dtype(zarray.dtype),
# codecs=zarray._v3_codec_pipeline(),
# dimension_names=var.dims,
# fill_value=zarray.fill_value,
# )

arr.update_attributes(
{k: encode_zarr_attr_value(v) for k, v in var.attrs.items()}
Expand Down

0 comments on commit 5084adf

Please sign in to comment.