Skip to content

Commit

Permalink
Fix docstrings and testset names
Browse files Browse the repository at this point in the history
  • Loading branch information
adrhill committed Aug 22, 2024
1 parent c0076fa commit 4228dbc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ext/SparseConnectivityTracerDataInterpolationsExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ else
end

# We assume with the exception of ConstantInterpolation and LinearInterpolation,
# all interpolations except are twice differentiable
# all interpolations have a non-zero second derivative at some point in the input domain.

(interp::AbstractInterpolation)(t::GradientTracer) = gradient_tracer_1_to_1(t, false)
(interp::ConstantInterpolation)(t::GradientTracer) = gradient_tracer_1_to_1(t, true)
Expand Down
12 changes: 6 additions & 6 deletions test/ext/test_DataInterpolations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ t = [0.0, 1.0, 3.0]
method = M()
J(f, x) = jacobian_sparsity(f, x, method)

@testset "Non-differentiable" begin
@testset "Zero first derivative, zero second derivative" begin
@testset "$T" for T in interpolations_z
interp = T(u, t)
@test J(interp, 2.0) [0;;]
end
end
@testset "First-order differentiable" begin
@testset "Non-zero first derivative, zero second derivative" begin
@testset "$T" for T in interpolations_f
interp = T(u, t)
@test J(interp, 2.0) [1;;]
end
end
@testset "Second-order differentiable" begin
@testset "Non-zero first derivative, non-zero second derivative" begin
@testset "$T" for T in interpolations_s
interp = T(u, t)
@test J(interp, 2.0) [1;;]
Expand All @@ -49,19 +49,19 @@ end
method = M()
H(f, x) = hessian_sparsity(f, x, method)

@testset "Non-differentiable" begin
@testset "Zero first derivative, zero second derivative" begin
@testset "$T" for T in interpolations_z
interp = T(u, t)
@test H(interp, 2.0) [0;;]
end
end
@testset "First-order differentiable" begin
@testset "Non-zero first derivative, zero second derivative" begin
@testset "$T" for T in interpolations_f
interp = T(u, t)
@test H(interp, 2.0) [0;;]
end
end
@testset "Second-order differentiable" begin
@testset "Non-zero first derivative, non-zero second derivative" begin
@testset "$T" for T in interpolations_s
interp = T(u, t)
@test H(interp, 2.0) [1;;]
Expand Down

0 comments on commit 4228dbc

Please sign in to comment.