JuliaIO / Zarr.jl

Other
120 stars 24 forks source link

zopen ignores `consolidate` keyword #159

Open felixcremer opened 2 months ago

felixcremer commented 2 months ago

If I try to open a Zarr file without consolidated metadata, the zopen keyword is ignored and Zarr tries to use a ConsolidatedStore.

julia> tiny = "https://s3.bgc-jena.mpg.de:9000/esdl-esdc-v3.0.2/esdc-16d-.25deg-460x720x1440-3.0.2.zarr"
"https://s3.bgc-jena.mpg.de:9000/esdl-esdc-v3.0.2/esdc-16d-.25deg-460x720x1440-3.0.2.zarr"

julia> Zarr.zopen(tiny, consolidated = false)
ERROR: ArgumentError: Could not find consolidated metadata for store Zarr.HTTPStore("https://s3.bgc-jena.mpg.de:9000/esdl-esdc-v3.0.2/esdc-16d-.25deg-460x720x1440-3.0.2.zarr", Set([404]))
Stacktrace:
 [1] Zarr.ConsolidatedStore(s::Zarr.HTTPStore, p::String)
   @ Zarr ~/.julia/packages/Zarr/3QSdj/src/Storage/consolidated.jl:14
 [2] storefromstring(::Type{Zarr.HTTPStore}, s::String, ::Bool)
   @ Zarr ~/.julia/packages/Zarr/3QSdj/src/Storage/http.jl:42
 [3] storefromstring(s::String, create::Bool)
   @ Zarr ~/.julia/packages/Zarr/3QSdj/src/ZGroup.jl:116
 [4] zopen(s::String, mode::String; kwargs::@Kwargs{consolidated::Bool})
   @ Zarr ~/.julia/packages/Zarr/3QSdj/src/ZGroup.jl:109
 [5] zopen
   @ ~/.julia/packages/Zarr/3QSdj/src/ZGroup.jl:108 [inlined]
 [6] top-level scope
   @ REPL[34]:1

Looking at the code it seems that the consolidated keyword is not forwarded to the storefromstring function and HTTP Stores are always assumed to be consolidated.