Skip to content

Commit

Permalink
fix: remove the checks
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Sep 25, 2024
1 parent 1e98987 commit 34602e1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions src/algorithms/klement.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ over this.
function Klement(; max_resets::Int = 100, linsolve = nothing, alpha = nothing,
linesearch = NoLineSearch(), precs = DEFAULT_PRECS,
autodiff = nothing, init_jacobian::Val{IJ} = Val(:identity)) where {IJ}
# if !(linesearch isa AbstractNonlinearSolveLineSearchAlgorithm)
# Base.depwarn(
# "Passing in a `LineSearches.jl` algorithm directly is deprecated. \
# Please use `LineSearchesJL` instead.", :Klement)
# linesearch = LineSearchesJL(; method = linesearch)
# end
if !(linesearch isa AbstractLineSearchAlgorithm)
Base.depwarn(
"Passing in a `LineSearches.jl` algorithm directly is deprecated. \
Please use `LineSearchesJL` instead.", :Klement)
linesearch = LineSearchesJL(; method = linesearch)
end

if IJ === :identity
initialization = IdentityInitialization(alpha, DiagonalStructure())
Expand Down
12 changes: 6 additions & 6 deletions src/core/approximate_jacobian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ function ApproximateJacobianSolveAlgorithm{concrete_jac, name}(;
linesearch = missing, trustregion = missing, descent, update_rule,
reinit_rule, initialization, max_resets::Int = typemax(Int),
max_shrink_times::Int = typemax(Int)) where {concrete_jac, name}
# if linesearch !== missing && !(linesearch isa AbstractNonlinearSolveLineSearchAlgorithm)
# Base.depwarn("Passing in a `LineSearches.jl` algorithm directly is deprecated. \
# Please use `LineSearchesJL` instead.",
# :GeneralizedFirstOrderAlgorithm)
# linesearch = LineSearchesJL(; method = linesearch)
# end
if linesearch !== missing && !(linesearch isa AbstractLineSearchAlgorithm)
Base.depwarn("Passing in a `LineSearches.jl` algorithm directly is deprecated. \
Please use `LineSearchesJL` instead.",
:GeneralizedFirstOrderAlgorithm)
linesearch = LineSearchesJL(; method = linesearch)
end
return ApproximateJacobianSolveAlgorithm{concrete_jac, name}(
linesearch, trustregion, descent, update_rule,
reinit_rule, max_resets, max_shrink_times, initialization)
Expand Down
12 changes: 6 additions & 6 deletions src/core/generalized_first_order.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ function GeneralizedFirstOrderAlgorithm{concrete_jac, name}(;
jacobian_ad !== nothing && ADTypes.mode(jacobian_ad) isa ADTypes.ReverseMode,
jacobian_ad, nothing))

# if linesearch !== missing && !(linesearch isa AbstractNonlinearSolveLineSearchAlgorithm)
# Base.depwarn("Passing in a `LineSearches.jl` algorithm directly is deprecated. \
# Please use `LineSearchesJL` instead.",
# :GeneralizedFirstOrderAlgorithm)
# linesearch = LineSearchesJL(; method = linesearch)
# end
if linesearch !== missing && !(linesearch isa AbstractLineSearchAlgorithm)
Base.depwarn("Passing in a `LineSearches.jl` algorithm directly is deprecated. \
Please use `LineSearchesJL` instead.",
:GeneralizedFirstOrderAlgorithm)
linesearch = LineSearchesJL(; method = linesearch)
end

return GeneralizedFirstOrderAlgorithm{concrete_jac, name}(
linesearch, trustregion, descent, max_shrink_times,
Expand Down

0 comments on commit 34602e1

Please sign in to comment.