You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* basic structure for writing a zarr store containing manifests
* write in nicely indented form
* use pathlib for everything
* documentation
* docstrings
* vendor zarr.utils.json_dumps
* remove consolidated metadata, as v3 doesn't have this yet
* license for vendoring part of zarr-python
* change to write v3
* implement reading from v3-compliant stores
* roundtripping test
* forgot to add the file with the test
* test dataset-level attributes
* debugging print
* try explicitly separating files from directories
Copy file name to clipboardExpand all lines: docs/usage.md
+21-2Lines changed: 21 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -338,6 +338,25 @@ Currently you can only serialize virtual variables backed by `ManifestArray` obj
338
338
339
339
### Writing as Zarr
340
340
341
-
TODO: Write out references as a Zarr v3 store following the [Chunk Manifest ZEP](https://github.com/zarr-developers/zarr-specs/issues/287), see [PR #45](https://github.com/TomNicholas/VirtualiZarr/pull/45)
341
+
Alternatively, we can write these references out as an actual Zarr store, at least one that is compliant with the [proposed "Chunk Manifest" ZEP](https://github.com/zarr-developers/zarr-specs/issues/287). To do this we simply use the {py:meth}`ds.virtualize.to_zarr <virtualizarr.xarray.VirtualiZarrDatasetAccessor.to_zarr>` accessor method.
342
342
343
-
TODO: Explanation of how this requires changes in zarr upstream to be able to read it
343
+
```python
344
+
combined_vds.virtualize.to_zarr('combined.zarr')
345
+
```
346
+
347
+
The result is a zarr v3 store on disk which contains the chunk manifest information written out as `manifest.json` files, so the store looks like this:
348
+
349
+
```
350
+
combined/zarr.json <- group metadata
351
+
combined/air/zarr.json <- array metadata
352
+
combined/air/manifest.json <- array manifest
353
+
...
354
+
```
355
+
356
+
The advantage of this format is that any zarr v3 reader that understands the chunk manifest ZEP could read from this store, no matter what language it is written in (e.g. via `zarr-python`, `zarr-js`, or rust). This reading would also not require `fsspec`.
357
+
358
+
```{note}
359
+
Currently there are not yet any zarr v3 readers which understand the chunk manifest ZEP, so until then this feature cannot be used for data processing.
360
+
361
+
This store can however be read by {py:func}`~virtualizarr.xarray.open_virtual_dataset`, by passing `filetype="zarr_v3"`.
0 commit comments