Skip to content

Commit

Permalink
Remove obsolete _guarantee_analytical
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeingold committed Nov 11, 2024
1 parent bf4a5fe commit 1067043
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
12 changes: 1 addition & 11 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,12 @@ function _error_unsupported_combination(geometry, rule)
throw(ArgumentError(msg))
end

# TODO test new version of parametric that doesn't require this
_constrain(t) = (t > 0) ? prevfloat(t) : t

################################################################################
# DifferentiationMethod
################################################################################
#=
# Throw an ArgumentError if Analytical() jacobian not defined for this type
function _guarantee_analytical(
::Type{G},
::DifferentiationMethod
) where {G <: Geometry}
throw(ArgumentError("$G geometries require kwarg diff_method = Analytical()"))
end
_guarantee_analytical(::Type{G}, ::Analytical) where {G <: Geometry} = nothing
=#

# Return whether a geometry type has jacobian methods defined
_has_analytical(::Type{G}) where {G <: Geometry} = false
Expand Down
5 changes: 1 addition & 4 deletions test/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ end

# _has_analytical of types
@test _has_analytical(Meshes.BezierCurve) == true

# _guarantee_analytical
@test _guarantee_analytical(Meshes.BezierCurve, Analytical()) === nothing
@test_throws "Analytical" _guarantee_analytical(Meshes.BezierCurve, FiniteDifference())
@test _has_analytical(Meshes.Sphere) == false

# _default_method
@test _default_method(Meshes.BezierCurve) isa Analytical
Expand Down

0 comments on commit 1067043

Please sign in to comment.