Skip to content

Commit

Permalink
Updates examples to newer Icechunk syntax (#431)
Browse files Browse the repository at this point in the history
* change coiled example to write to icechunk & update noaa append example to newer icechunk syntax

* successfull run of coiled example with updated icechunk syntax

* minor nits to icechunk noaa append ex

* updated icechunk syntax - this worked!

* clean e2e run of append notebook

* slight fmt nits to icechunk section in usage docs
  • Loading branch information
norlandrhagen authored Feb 13, 2025
1 parent 75610e6 commit 7cbc913
Show file tree
Hide file tree
Showing 3 changed files with 1,349 additions and 130 deletions.
8 changes: 4 additions & 4 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,15 +426,15 @@ By default references are placed in separate parquet file when the total number

### Writing to an Icechunk Store

We can also write these references out as an [IcechunkStore](https://icechunk.io/). `Icechunk` is a Open-source, cloud-native transactional tensor storage engine that is compatible with zarr version 3. To export our virtual dataset to an `Icechunk` Store, we simply use the {py:meth}`vds.virtualize.to_icechunk <virtualizarr.VirtualiZarrDatasetAccessor.to_icechunk>` accessor method.
We can also write these references out as an [IcechunkStore](https://icechunk.io/). `Icechunk` is an open-source, cloud-native transactional tensor storage engine that is compatible with Zarr version 3. To export our virtual dataset to an `Icechunk` Store, we simply use the {py:meth}`vds.virtualize.to_icechunk <virtualizarr.VirtualiZarrDatasetAccessor.to_icechunk>` accessor method.

```python
# create an icechunk repository, session and write the virtual dataset to the session
from icechunk import Repository, Storage, VirtualChunkContainer, local_filesystem_storage
import icechunk
storage = local_filesystem_storage("./local/icechunk/store")

# By default, local virtual references and public remote virtual references can be read wihtout extra configuration.
repo = Repository.create(storage=storage)
repo = icechunk.Repository.create(storage)
session = repo.writeable_session("main")

# write the virtual dataset to the session with the IcechunkStore
Expand All @@ -455,7 +455,7 @@ session.commit("Appended second dataset")
```

See the [Icechunk documentation](https://icechunk.io/icechunk-python/virtual/#creating-a-virtual-dataset-with-virtualizarr) for more details.

icechunk-python/virtual/#creating-a-virtual-dataset-with-virtualizarr


## Opening Kerchunk references as virtual datasets
Expand Down
Loading

0 comments on commit 7cbc913

Please sign in to comment.