Builds a self-contained Icechunk repository in a temporary directory, for examples and experiments. Nothing is downloaded. It holds:
Usage
ic_example_repo(path = tempfile("icechunk-example-"))Value
A list with path (the repository), authorize (the
container's URL prefix, file://...), source (the directory holding
grid.bin and grid.nc) and values (the virtual arrays' values).
Details
/from_bin: float32, 64 x 48, chunks 16 x 48. Four virtual references into a raw binary filegrid.bin, one per 16-row block./from_nc: float32, 64 x 48, one chunk. A virtual reference intogrid.ncat offset 2048 (a 2048-byte header, then the same values)./small: float64, 4 x 6, chunks 2 x 3, values1:24in C order, written through the session in a second commit. Its chunks are small enough (48 bytes) that Icechunk keeps them inline in the manifest.
The values of the virtual arrays are (0:3071) / 4, little-endian
float32 in C order. Both source files live in a directory next to the
repository, declared as a virtual chunk container. Like any container,
it must be authorised before its chunks are read: pass $authorize to
ic_repo_open() or DBI::dbConnect(). The first commit is tagged v1.
Examples
ex <- ic_example_repo()
repo <- ic_repo_open(ex$path, authorize = ex$authorize)
repo
#> <icechunk_repo> spec v2
#> storage: local: /tmp/RtmpVaRScy/icechunk-example-35c91fadc056/repo
#> branches: main
#> tags: v1
ic_nodes(ic_session_readonly(repo, branch = "main"))
#> path type shape num_chunks dimension_names
#> 1 / group <NA> <NA> <NA>
#> 2 /from_bin array 64,48 4,1 y,x
#> 3 /from_nc array 64,48 1,1 y,x
#> 4 /small array 4,6 2,2 y,x