Skip to content

Commit

Permalink
merge not_convert_missing_values
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Barth committed Mar 15, 2022
2 parents 49592f1 + 5fe2943 commit b9e07aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/cfvariable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ function cfvariable(ds,

storage_attrib = (
fillvalue = fillvalue,
missing_values = (T.(missing_value)...,),
missing_values = (missing_value...,),
scale_factor = scale_factor,
add_offset = add_offset,
calendar = calendar,
Expand Down
7 changes: 7 additions & 0 deletions test/test_missing_value.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,12 @@ data = [0., 123., 124.]
v.var[:] = data
@test isequal(v[:],[0.,missing,missing])


# missing values of wrong type
v = defVar(ds,"var3",Float64,("dim",), attrib = OrderedDict("missing_value" => "value of wrong type"))
data = [0., 1., 2.]
v.var[:] = data
@test isequal(v[:],[0.,1.,2.])

close(ds)

0 comments on commit b9e07aa

Please sign in to comment.