Skip to content

Commit

Permalink
Add tests for IDW
Browse files Browse the repository at this point in the history
  • Loading branch information
juliohm committed Sep 16, 2023
1 parent cabc485 commit 004a69d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/idw.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@testset "IDW" begin
@testset "Unitful" begin
d = georef((; z=[1.0, 0.0, 1.0]u"K"))
idw = GeoStatsModels.fit(IDW(), d)
pred = GeoStatsModels.predict(idw, :z, Point(0.0))
@test unit(pred) == u"K"

# affine units
d = georef((; z=[1.0, 0.0, 1.0]u"°C"))
idw = GeoStatsModels.fit(IDW(), d)
#pred = GeoStatsModels.predict(idw, :z, Point(0.0))
#@test unit(pred) == u"K"
end

@testset "CoDa" begin
d = georef((; z=[Composition(0.1, 0.2), Composition(0.3, 0.4), Composition(0.5, 0.6)]))
idw = GeoStatsModels.fit(IDW(), d)
pred = GeoStatsModels.predict(idw, :z, Point(0.0))
@test pred isa Composition
end
end

0 comments on commit 004a69d

Please sign in to comment.