Skip to content

Commit 0562453

Browse files
committed
Test rational writing only for zarr
1 parent 7e527f9 commit 0562453

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ julia = "1.9"
1414
ArchGDAL = "0.10"
1515
AxisArrays = "0.4"
1616
AxisKeys = "0.2"
17-
DimensionalData = "0.27, 0.28, 0.29"
17+
DimensionalData = "0.27, 0.28, 0.29, 0.30"
1818
NetCDF = "0.11, 0.12"
1919
Zarr = "0.8, 0.9"
2020

test/datasets.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,14 @@ function test_write(T)
9999
add_var(ds, 0.5:1:9.5, "lon", ("lon",), Dict("units"=>"degrees_east"))
100100
add_var(ds, 20:-1.0:1, "lat", ("lat",), Dict("units"=>"degrees_north"))
101101
v = add_var(ds, Float32, "tas", (10,20), ("lon", "lat"), Dict{String,Any}("units"=>"Celsius"))
102-
w = add_var(ds, Rational{Int}, "tas2", (10,20), ("lon", "lat"), Dict{String,Any}("units"=>"Celsius"))
102+
if T isa YAXArrayBase.backendlist[:zarr]
103+
w = add_var(ds, Rational{Int}, "tas2", (10,20), ("lon", "lat"), Dict{String,Any}("units"=>"Celsius"))
104+
w[:,:] = collect(reshape(1:200, 10, 20)) .// 2
105+
w = get_var_handle(ds, "tas2")
106+
@test w[1:2,1:2] == [1 11; 2 12] .// 2
107+
end
103108
v[:,:] = collect(reshape(1:200, 10, 20))
104-
w[:,:] = collect(reshape(1:200, 10, 20)) .// 2
109+
105110
@test sort(get_varnames(ds)) == ["lat","lon","tas", "tas2"]
106111
@test get_var_dims(ds, "tas") == ["lon", "lat"]
107112
@test get_var_dims(ds, "lon") == ["lon"]

0 commit comments

Comments
 (0)