Skip to content

Commit

Permalink
Reduce number of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielVandH committed May 9, 2024
1 parent b612c80 commit 95a1f50
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/helper_functions/test_functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ end

function test_interpolant(itp, x, y, f)
for method in (Farin(1), :sibson, :triangle, :nearest, :laplace, Sibson(1), Hiyoshi(2))
for _ in 1:500
for _ in 1:25
vals = itp(x, y; parallel=false, method)
vals2 = similar(vals)
itp(vals2, x, y; parallel=false, method)
Expand Down
8 changes: 4 additions & 4 deletions test/interpolation/coordinates/natural_coordinates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ to_mat(H) = [H[1] H[3]; H[3] H[2]]
method = NNI.iwrap(method)
pts = [(0.0, 8.0), (0.0, 0.0), (14.0, 0.0), (14.0, 8.0), (4.0, 4.0), (10.0, 6.0), (6.0, 2.0), (12.0, 4.0), (0.0, 4.0)]
tri = triangulate(pts, randomise=false, delete_ghosts=false)
n = 2500
n = 250
pts = random_points_in_convex_hull(tri, n)
for p in Iterators.flatten((pts, DelaunayTriangulation.each_point(tri)))
natural_coordinates = NNI.compute_natural_coordinates(method, tri, p)
Expand All @@ -27,10 +27,10 @@ to_mat(H) = [H[1] H[3]; H[3] H[2]]
end
end

for _ in 1:50
for _ in 1:5
pts = [(randn() + rand(), rand() - 2randn()) for _ in 1:250]
tri = triangulate(pts, delete_ghosts=false)
n = 5000
n = 500
random_points = random_points_in_convex_hull(tri, n)
for p in Iterators.flatten((random_points, DT.each_point(tri)))
natural_coordinates = NNI.compute_natural_coordinates(method, tri, p)
Expand Down Expand Up @@ -63,7 +63,7 @@ function _circular_equality(A, B, by=isequal; kwargs...) # slightly tweaked vers
end

@testset "Test coefficient values for each method" begin # used GeoGebra
for _ in 1:10 # make sure rng is getting passed consistently
for _ in 1:3 # make sure rng is getting passed consistently
# Setup
rng = StableRNG(872973)
pts = [(0.0, 8.0), (0.0, 0.0), (14.0, 0.0),
Expand Down
16 changes: 16 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,58 +6,74 @@ include("jet_aqua.jl")

@testset "Interpolation" begin
@testset "Coordinates" begin
@info "Testing NaturalCoordinates"
@safetestset "Natural Coordinates" begin
include("interpolation/coordinates/natural_coordinates.jl")
end
@info "Testing Utils"
@safetestset "Utils" begin
include("interpolation/coordinates/utils.jl")
end
end
@info "Testing Basic Tests"
@safetestset "Basic Tests" begin
include("interpolation/basic_tests.jl")
end
@info "Testing Precision"
@safetestset "Precision" begin
include("interpolation/precision.jl")
end
@info "Testing Extrapolation"
@safetestset "Extrapolation" begin
include("interpolation/extrapolation.jl")
end
@info "Testing Structs"
@safetestset "Structs" begin
include("interpolation/structs.jl")
end
@info "Testing Influence"
@safetestset "Influence" begin
include("interpolation/influence.jl")
end
@info "Testing Constrained Triangulation"
@safetestset "Constrained Triangulations" begin
include("interpolation/constrained.jl")
end
end

@testset "Differentiation" begin
@info "Testing Basic Tests"
@safetestset "Basic Tests" begin
include("differentiation/basic_tests.jl")
end
@info "Testing Structs"
@safetestset "Structs" begin
include("differentiation/structs.jl")
end
@info "Testing Utils"
@safetestset "Utils" begin
include("differentiation/utils.jl")
end
end

@testset "Documentation Examples" begin
@info "Testing README Example"
@safetestset "README Example" begin
include("doc_examples/readme_example.jl")
end
@info "Testing Interpolation Example"
@safetestset "Interpolation Example" begin
include("doc_examples/interpolation.jl")
end
@info "Testing Differentiation Example"
@safetestset "Differentiation Example" begin
include("doc_examples/differentiation.jl")
end
@info "Testing Interpolation Math"
@safetestset "Interpolation Math" begin
include("doc_examples/interpolation_math.jl")
end
@info "Testing Switzerland"
@safetestset "Switzerland" begin
include("doc_examples/swiss.jl")
end
Expand Down

4 comments on commit 95a1f50

@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/106460

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

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.3.1 -m "<description of version>" 95a1f50d01be75026375304f45cd1b480c4c5571
git push origin v1.3.1

@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 updated: JuliaRegistries/General/106460

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

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.3.1 -m "<description of version>" 95a1f50d01be75026375304f45cd1b480c4c5571
git push origin v1.3.1

Please sign in to comment.