Skip to content

Commit 52ce622

Browse files
author
Vincent Landau
committed
update tests for coverage
1 parent 4588951 commit 52ce622

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ end
1616
include("weightedrasterdigraphs.jl")
1717
end
1818

19-
@testset "Checking LightGraphs Interface" begin
19+
@testset "LightGraphs Interface" begin
2020
include("lg_interface.jl")
2121
end
2222

test/weightedrastergraphs.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ band = Band(1:1)
88

99
weight_raster = GeoArray(A_array, (y, x, band), missingval = -9999)
1010
weight_raster2d = GeoArray(A_array[:, :, 1], (y, x), missingval = -9999)
11-
rasgraph2d = weightedrastergraph(weight_raster2d)
12-
rasgraph = weightedrastergraph(weight_raster)
11+
rasgraph2d = weightedrastergraph(
12+
weight_raster2d,
13+
connect_using_avg_weights = false
14+
)
15+
rasgraph = weightedrastergraph(weight_raster, connect_using_avg_weights = false)
1316

1417
# Test that graphs are the same regardless of whether weight_raster has Band dim
1518
@test rasgraph2d.graph == rasgraph.graph
@@ -48,11 +51,11 @@ for i in 1:length(graph_edges)
4851
# Test that the weight is what it should be (assumes connect_using_avg_weights = true in graph construction)
4952
if (row_diff == 1 && col_diff == 1) # get diagonal average
5053
@test weight_i ==
51-
SpatialGraphs.res_diagonal_avg(weight_raster[source_coords],
54+
SpatialGraphs.cond_diagonal_avg(weight_raster[source_coords],
5255
weight_raster[dest_coords])
5356
else
5457
@test weight_i ==
55-
SpatialGraphs.res_cardinal_avg(weight_raster[source_coords],
58+
SpatialGraphs.cond_cardinal_avg(weight_raster[source_coords],
5659
weight_raster[dest_coords])
5760
end
5861
end

0 commit comments

Comments
 (0)