How to use Zarrj.zgroup? #82
Unanswered
truedichotomy
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Sorry for the lack of documentation. Here are a few examples, let me know when you need more. There definitely should be a section of working with groups in the docs. julia> p = tempname()
"/tmp/jl_hKDcSI"
#Create a new Zarr group at path p
julia> g = zgroup(p)
ZarrGroup at DirectoryStore("/tmp/jl_hKDcSI") and path
#Create a sub-group of the group g
julia> g2 = zgroup(g,"subgroup")
ZarrGroup at DirectoryStore("/tmp/jl_hKDcSI") and path subgroup
#Create a new array inside group g2
julia> a = zcreate(Float32,g2,"anarray",10,5,2)
ZArray{Float32} of size 10 x 5 x 2
#Now g2 contains the array
julia> g2.arrays
Dict{String, ZArray} with 1 entry:
"anarray" => ZArray{Float32} of size 10 x 5 x 2
#We open the base group and go through the hierarchy
julia> zopen(p)["subgroup"]["anarray"]
ZArray{Float32} of size 10 x 5 x 2
#Alternatively, for an existing store:
julia> s = Zarr.DictStore()
Dictionary Storage
#Create a Zarr group in the given store at path "mygroup"
julia> g = zgroup(s,"mygroup")
ZarrGroup at Dictionary Storage and path mygroup |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I"d like to use the group functionality of Zarr. There is no documentation for it, can you give a couple of examples? Thanks.
Beta Was this translation helpful? Give feedback.
All reactions