Skip to content

Commit

Permalink
Always use a fillvalue
Browse files Browse the repository at this point in the history
  • Loading branch information
meggart committed Jul 22, 2022
1 parent d4699b5 commit cfe4c33
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/datasets/zarr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cfe4c33

Please sign in to comment.