Skip to content

Commit 246bf89

Browse files
committed
Describe the new method in the readme and docstring
1 parent b8266b5 commit 246bf89

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,14 @@ NCDataset("$(dataset_id)_selection.nc","c") do ds_nc
4949
write(ds_nc,ds_sub)
5050
end
5151
```
52+
53+
## Using a pre-existing Zarr array or store
54+
55+
It's also simple to wrap an existing Zarr array, or a manually constructed Zarr store, in a `ZarrDataset`:
56+
57+
```julia
58+
zg = zopen("/path/to/zarr")
59+
zd = ZarrDataset(zg)
60+
```
61+
62+
and you can pass a constructed `Zarr.AbstractStore` similarly.

src/dataset.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ CDM.maskingvalue(ds::ZarrDataset) = ds.maskingvalue
8383
ds = ZarrDataset(url::AbstractString,mode = "r";
8484
_omitcode = [404,403],
8585
maskingvalue = missing)
86+
ZarrDataset(zg::Zarr.ZGroup; _omitcode, maskingvalue)
8687
ZarrDataset(f::Function,url::AbstractString,mode = "r";
8788
maskingvalue = missing)
8889

0 commit comments

Comments
 (0)