julia
module Kerchunk
using JSON3, Base64 # for decoding
using URIs, Mustache # to resolve paths
using FilePathsBase, AWSS3 # to access files
using Zarr # this is where the magic happensZarr filters that are not yet released in Zarr.jl
julia
@static if !(:FixedScaleOffsetFilter in names(Zarr; all = true))
include("required_zarr_filters.jl")
endUtility functions
julia
include("readbytes.jl")Reference store implementation
julia
include("referencestore.jl")Missing Zarr filters
julia
include("astype_filter.jl")
include("zlib_compressor.jl")CF corrections in style
julia
include("cf_corrections.jl")Materializing a reference store
julia
include("materialize.jl")
export ReferenceStoreFile paths from Zarr stores
julia
include("zarrstorepath.jl")
export ZarrStorePathThe __init__ function always runs when the package is loaded, and we use it to mutate registry arrays and dicts in other packages (Zarr) that wouldn't work if you tried to precompile it. This is because the modifications are active in the precompile session, but are not saved to the other package's precompile file.
julia
function __init__()
push!(Zarr.storageregexlist, r"^reference://"=>ReferenceStore)
Zarr.filterdict["astype"] = AstypeFilter
Zarr.compressortypes["zstd"] = ZstdCompressor
@static if !(:FixedScaleOffsetFilter in names(Zarr; all = true))
filterdict["delta"] = DeltaFilter
filterdict["fixedscaleoffset"] = FixedScaleOffsetFilter
filterdict["fletcher32"] = Fletcher32Filter
filterdict["quantize"] = QuantizeFilter
filterdict["shuffle"] = ShuffleFilter
end
end
endThis page was generated using Literate.jl.