-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
forgot to add the file with the test
- Loading branch information
1 parent
79f39e1
commit 98a259e
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import xarray as xr | ||
import numpy as np | ||
import xarray.testing as xrt | ||
from virtualizarr import open_virtual_dataset, ManifestArray | ||
from virtualizarr.manifests.manifest import ChunkEntry | ||
|
||
|
||
def test_zarr_v3_roundtrip(tmpdir): | ||
arr = ManifestArray( | ||
chunkmanifest={"0.0": ChunkEntry(path="test.nc", offset=6144, length=48)}, | ||
zarray=dict( | ||
shape=(2, 3), | ||
dtype=np.dtype("<i8"), | ||
chunks=(2, 3), | ||
compressor=None, | ||
filters=None, | ||
fill_value=None, | ||
order="C", | ||
zarr_format=3, | ||
), | ||
) | ||
original = xr.Dataset({"a": (["x", "y"], arr)}) | ||
|
||
original.virtualize.to_zarr(tmpdir / "store.zarr") | ||
roundtrip = open_virtual_dataset(tmpdir / "store.zarr", filetype="zarr_v3", indexes={}) | ||
|
||
xrt.assert_identical(roundtrip, original) |