Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/ZarrCoreExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ end

YAB.create_empty(::Type{ZarrDataset}, path, gatts=Dict(); format=2, kwargs...) =
ZarrDataset(zgroup(ZarrCore.storefromstring(path, true)..., format; attrs=gatts))
zarr_format(ds::ZarrDataset) = zarr_format(ds.g.metadata)
zarr_format(ds::ZarrDataset) = Int(ds.g.zarr_format)



Expand Down
8 changes: 4 additions & 4 deletions test/datasets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ end
h = get_var_handle(ds_loaded, "tas")
@test h[:, :] == reshape(1:12, 3, 4)
@test !YAXArrayBase.iscompressed(h)
@test !YAXArrayBase.iscompressed(zcreate(Float32, 3, 4, format=3))
@test !YAXArrayBase.iscompressed(zcreate(Float32, 3, 4; zarr_format=3))
@test_throws "ZarrZip" to_dataset(tempname() * ".zarr.zip")
end

using ZarrHTTP, ZarrBlosc, ZarrZip

@testset "Zarr iscompressed" begin
for format in (2, 3)
@test YAXArrayBase.iscompressed(zcreate(Float32, 3, 4; format))
@test !YAXArrayBase.iscompressed(zcreate(Float32, 3, 4; format, compressor=ZarrCore.NoCompressor()))
@test YAXArrayBase.iscompressed(zcreate(Float32, 3, 4; zarr_format=format))
@test !YAXArrayBase.iscompressed(zcreate(Float32, 3, 4; zarr_format=format, compressor=ZarrCore.NoCompressor()))
end
end

Expand Down Expand Up @@ -203,7 +203,7 @@ import JSON
@test length(nodes) == 6
for n in nodes
j = JSON.parsefile(n)
@test j["format"] == 3
@test j["zarr_format"] == 3
if j["node_type"] == "array"
@test haskey(j, "dimension_names")
@test !haskey(get(j, "attributes", Dict()), "_ARRAY_DIMENSIONS")
Expand Down