Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Also error that gradients are needed for Hiyoshi-2 #20

Merged
merged 3 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "NaturalNeighbours"
uuid = "f16ad982-4edb-46b1-8125-78e5a8b5a9e6"
authors = ["Daniel VandenHeuvel <danj.vandenheuvel@gmail.com>"]
version = "1.2.0"
version = "1.2.1"

[deps]
ChunkSplitters = "ae650224-84b6-46f8-82ea-d812ca08434e"
Expand Down
2 changes: 1 addition & 1 deletion src/interpolation/eval.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ end
@inline function _eval_interp(method::Union{<:Farin,Sibson{1}}, itp::NaturalNeighboursInterpolant, p, cache; kwargs...)
gradients = get_gradient(itp)
if isnothing(gradients)
throw(ArgumentError("Gradients must be provided for Sibson-1 or Farin interpolation. Consider using e.g. interpolate(tri, z; derivatives = true)."))
throw(ArgumentError("Gradients must be provided for Sibson-1, Farin, or Hiyoshi-2 interpolation. Consider using e.g. interpolate(tri, z; derivatives = true)."))
end
tri = get_triangulation(itp)
nc = compute_natural_coordinates(Sibson(), tri, p, cache; kwargs...)
Expand Down
2 changes: 1 addition & 1 deletion test/interpolation/basic_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ end
f′′ = (x, y) -> [2+6x*y 3x^2; 3x^2 2]
z = [f(x, y) for (x, y) in each_point(tri)]
itp = interpolate(tri, z; derivatives=false)
@test_throws ArgumentError("Gradients must be provided for Sibson-1 or Farin interpolation. Consider using e.g. interpolate(tri, z; derivatives = true).") itp(0.5, 0.5; method=Sibson(1))
@test_throws ArgumentError("Gradients must be provided for Sibson-1, Farin, or Hiyoshi-2 interpolation. Consider using e.g. interpolate(tri, z; derivatives = true).") itp(0.5, 0.5; method=Sibson(1))
end

@testset "Hiyoshi(2) errors without gradients and Hessians" begin
Expand Down
Loading