Skip to content

Commit

Permalink
Merge pull request #20 from DanielVandH/hiyoshi-warn
Browse files Browse the repository at this point in the history
Also error that gradients are needed for Hiyoshi-2
  • Loading branch information
DanielVandH authored Sep 7, 2023
2 parents 09d4f6f + 0417923 commit 5e420e3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
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 <[email protected]>"]
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

2 comments on commit 5e420e3

@DanielVandH
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/90965

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.2.1 -m "<description of version>" 5e420e3a6f89bd711e6cd1e348f7cf2af4053ce6
git push origin v1.2.1

Please sign in to comment.