From cfe4c33eedf033622391a68dfddd609f13762b27 Mon Sep 17 00:00:00 2001 From: Fabian Gans Date: Fri, 22 Jul 2022 17:26:24 +0200 Subject: [PATCH] Always use a fillvalue --- src/datasets/zarr.jl | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/datasets/zarr.jl b/src/datasets/zarr.jl index c4941a2..44bb11d 100644 --- a/src/datasets/zarr.jl +++ b/src/datasets/zarr.jl @@ -28,11 +28,8 @@ Base.haskey(ds::ZarrDataset,k) = haskey(ds.g,k) function add_var(p::ZarrDataset, T::Type, varname, s, dimnames, attr; chunksize=s, fill_as_missing=false, kwargs...) - default_fillvalue(T) = T<:AbstractFloat ? T(NaN) : typemax(T) attr2 = merge(attr,Dict("_ARRAY_DIMENSIONS"=>reverse(collect(dimnames)))) - fv = get(attr,"_FillValue",get(attr,"missing_value",default_fillvalue(T))) - delete!(attr2,"_FillValue") - delete!(attr2,"missing_value") + fv = get(attr,"_FillValue",get(attr,"missing_value",defaultfillval(T))) za = zcreate(T, p.g, varname,s...;fill_value = fv,fill_as_missing,attrs=attr2,chunks=chunksize,kwargs...) za end