Skip to content

Commit 117552c

Browse files
committed
Add some tests
1 parent 0fc2168 commit 117552c

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

src/axisarrays/archgdal.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function dimname(::AbstractRasterBand, i)
4040
elseif i == 2
4141
return :X
4242
else
43-
error("RasterDataset only has 3 dimiensions")
43+
error("RasterDataset only has 3 dimensions")
4444
end
4545
end
4646
function dimvals(b::AbstractRasterBand, i)
@@ -50,7 +50,7 @@ function dimvals(b::AbstractRasterBand, i)
5050
elseif i == 2
5151
range(geo[4],length=height(b), step=geo[6])
5252
else
53-
error("RasterDataset only has 3 dimiensions")
53+
error("RasterDataset only has 3 dimensions")
5454
end
5555
end
5656
iscontdim(a::AbstractRasterBand, i) = true

test/arrays.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ end
2828
@test dimvals(d,2) == 1.5:0.5:3.0
2929
end
3030

31+
@testset "NamedTuples" begin
32+
d = yaxconvert(NamedTuple,M())
33+
@test d isa NamedTuple
34+
@test getdata(d) == reshape(1:12,3,4)
35+
@test YAXArrayBase.dimnames(d) == (:x, :y)
36+
@test dimvals(d,1) == 0.5:1.0:2.5
37+
@test dimvals(d,2) == 1.5:0.5:3.0
38+
end
39+
3140
@testset "NamedDims" begin
3241
using NamedDims: NamedDimsArray
3342
d = yaxconvert(NamedDimsArray,M())
@@ -48,7 +57,7 @@ end
4857
end
4958

5059
@testset "ArchGDAL" begin
51-
p = download("https://download.osgeo.org/geotiff/samples/gdal_eg/cea.tif")
60+
p = Downloads.download("https://download.osgeo.org/geotiff/samples/gdal_eg/cea.tif")
5261
using ArchGDAL
5362
AG=ArchGDAL
5463
r = AG.readraster(p)

test/datasets.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using YAXArrayBase, NetCDF, Zarr, Test
22

33
@testset "Reading NetCDF" begin
4-
p = download("https://www.unidata.ucar.edu/software/netcdf/examples/sresa1b_ncar_ccsm3-example.nc")
4+
p = Downloads.download("https://www.unidata.ucar.edu/software/netcdf/examples/sresa1b_ncar_ccsm3-example.nc")
55

66
p2 = mv(p,string(tempname(),".nc"))
77

0 commit comments

Comments
 (0)