From 267016cc24126894d0b630d98f675e33ebdd0733 Mon Sep 17 00:00:00 2001 From: Daniel VandenHeuvel <95613936+DanielVandH@users.noreply.github.com> Date: Mon, 8 Jul 2024 01:19:38 +0100 Subject: [PATCH 1/4] Update interpolate.jl --- src/interpolation/interpolate.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/interpolation/interpolate.jl b/src/interpolation/interpolate.jl index dfd99cf..546024b 100644 --- a/src/interpolation/interpolate.jl +++ b/src/interpolation/interpolate.jl @@ -77,7 +77,7 @@ struct Triangle{D} <: AbstractInterpolator{D} allow_cache::Bool s::Dict{NTuple{3,Int},NTuple{9,Float64}} end -Triangle{D}(; allow_cache=false) where {D} = Triangle{D}(allow_cache, Dict{NTuple{3,Int},Float64}()) +Triangle{D}(; allow_cache=true) where {D} = Triangle{D}(allow_cache, Dict{NTuple{3,Int},Float64}()) Base.empty!(method::Triangle) = empty!(method.s) function populate_cache!(method::Triangle, tri::Triangulation) @@ -116,8 +116,8 @@ Interpolate using a piecewise linear interpolant over the underlying triangulati If you only ever call the scalar-argument version of the interpolant, no caching will be done even with `allow_cache = true`. -""" Triangle(; allow_cache=false) = Triangle{0}(; allow_cache) -Triangle(d; allow_cache=false) = Triangle(; allow_cache) +""" Triangle(; allow_cache=true) = Triangle{0}(; allow_cache) +Triangle(d; allow_cache=true) = Triangle(; allow_cache) @doc """ Nearest() From 0e19ba589d96f7ad0d602668cf746133f492b174 Mon Sep 17 00:00:00 2001 From: Daniel VandenHeuvel <95613936+DanielVandH@users.noreply.github.com> Date: Mon, 8 Jul 2024 01:20:02 +0100 Subject: [PATCH 2/4] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index d4fc46d..c6cd08c 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "NaturalNeighbours" uuid = "f16ad982-4edb-46b1-8125-78e5a8b5a9e6" authors = ["Daniel VandenHeuvel "] -version = "1.3.4" +version = "1.3.5" [deps] ChunkSplitters = "ae650224-84b6-46f8-82ea-d812ca08434e" From 2568d850abda68c4055dacdda59497250079bb87 Mon Sep 17 00:00:00 2001 From: DanielVandH Date: Mon, 8 Jul 2024 01:40:57 +0100 Subject: [PATCH 3/4] fix --- test/interpolation/basic_tests.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/interpolation/basic_tests.jl b/test/interpolation/basic_tests.jl index c41ed57..ca27959 100644 --- a/test/interpolation/basic_tests.jl +++ b/test/interpolation/basic_tests.jl @@ -170,8 +170,8 @@ end @testset "Testing Triangle()'s cache" begin tri = triangulate(rand(2, 50)) - method = Triangle() - method2 = Triangle(; allow_cache=true) + method2 = Triangle() + method2 = Triangle(; allow_cache=false) s = Dict{NTuple{3,Int},NTuple{9,Float64}}() for T in each_solid_triangle(tri) V = DelaunayTriangulation.sort_triangle(T) From ab29b839a1a31c0993df3cb239796a7ccb21f065 Mon Sep 17 00:00:00 2001 From: Daniel VandenHeuvel <95613936+DanielVandH@users.noreply.github.com> Date: Mon, 8 Jul 2024 02:00:09 +0100 Subject: [PATCH 4/4] Update basic_tests.jl --- test/interpolation/basic_tests.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/interpolation/basic_tests.jl b/test/interpolation/basic_tests.jl index ca27959..91eeac5 100644 --- a/test/interpolation/basic_tests.jl +++ b/test/interpolation/basic_tests.jl @@ -171,7 +171,7 @@ end @testset "Testing Triangle()'s cache" begin tri = triangulate(rand(2, 50)) method2 = Triangle() - method2 = Triangle(; allow_cache=false) + method = Triangle(; allow_cache=false) s = Dict{NTuple{3,Int},NTuple{9,Float64}}() for T in each_solid_triangle(tri) V = DelaunayTriangulation.sort_triangle(T) @@ -197,4 +197,4 @@ end @test sum(s[V]) ≈ 1.0 end @test method2.s == s # make sure that method2 knows to regenerate the cache -end \ No newline at end of file +end