-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not treat Zarr fill_value as CF _FillValue for coordinate variables
- Loading branch information
1 parent
135506d
commit a84ef0a
Showing
4 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using ZarrDatasets | ||
using Test | ||
using Zarr | ||
|
||
fname = tempname() | ||
mkdir(fname) | ||
|
||
# CF coordinate variable with Zarr fill_value set | ||
|
||
store = Zarr.DirectoryStore(fname) | ||
zg = zgroup(store, "") | ||
zarray = zcreate( | ||
Int, zg, "lon", 3; | ||
fill_value = 9999, | ||
attrs = Dict("_ARRAY_DIMENSIONS" => ("lon",))) | ||
|
||
ds = ZarrDataset(fname) | ||
@test eltype(ds["lon"]) == Int | ||
|
||
fname = tempname() | ||
mkdir(fname) | ||
|
||
ds = ZarrDataset(fname,"c") | ||
|
||
# variable which is not a CF coordinate variable | ||
v2 = defVar(ds,"foo",Int,(),fillvalue=9999) | ||
@test eltype(v2) == Union{Missing,Int} | ||
|
||
v3 = defVar(ds,"bar",Int16[2,3,4],("time",),fillvalue=9999) | ||
@test eltype(v3) == Union{Missing,Int16} | ||
close(ds) |