Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/NonlinearSolvePETScExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function SciMLBase.__solve(
end

if petsclibidx === nothing
error("No compatible PETSc library found for element type $(T). Pass in a \
error(lazy"No compatible PETSc library found for element type $(T). Pass in a \
custom `petsclib` via `PETScSNES(; petsclib = <petsclib>, ....)`.")
end
petsclib = PETSc.petsclibs[petsclibidx]
Expand Down
2 changes: 1 addition & 1 deletion ext/NonlinearSolveSIAMFANLEquationsExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function siamfanlequations_retcode_mapping(sol)
elseif sol.errcode == -1
return ReturnCode.Default
else
error("Unknown SIAMFANLEquations return code: $(sol.errcode)")
error(lazy"Unknown SIAMFANLEquations return code: $(sol.errcode)")
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/NonlinearSolveBase/src/abstract_types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ function Base.show(io::IO, ::MIME"text/plain", cache::AbstractNonlinearSolveCach
end

function show_nonlinearsolve_cache(io::IO, cache::AbstractNonlinearSolveCache, indent = 0)
println(io, "$(nameof(typeof(cache)))(")
println(io, lazy"$(nameof(typeof(cache)))(")
show_nonlinearsolve_algorithm(
io,
cache.alg,
Expand Down
10 changes: 5 additions & 5 deletions lib/NonlinearSolveBase/src/autodiff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ function select_forward_mode_autodiff(
if warn_check_mode && !(ADTypes.mode(ad) isa ADTypes.ForwardMode) &&
!(ADTypes.mode(ad) isa ADTypes.ForwardOrReverseMode) &&
!is_finite_differences_backend(ad)
@warn "The chosen AD backend $(ad) is not a forward mode AD. Use with caution."
@warn lazy"The chosen AD backend $(ad) is not a forward mode AD. Use with caution."
end
if incompatible_backend_and_problem(prob, ad)
adₙ = select_forward_mode_autodiff(prob, nothing; warn_check_mode)
@warn "The chosen AD backend `$(ad)` does not support the chosen problem. This \
@warn lazy"The chosen AD backend `$(ad)` does not support the chosen problem. This \
could be because the backend package for the chosen AD isn't loaded. After \
running autodiff selection detected `$(adₙ)` as a potential forward mode \
backend."
Expand All @@ -50,11 +50,11 @@ function select_reverse_mode_autodiff(
if warn_check_mode && !(ADTypes.mode(ad) isa ADTypes.ReverseMode) &&
!(ADTypes.mode(ad) isa ADTypes.ForwardOrReverseMode) &&
!is_finite_differences_backend(ad)
@warn "The chosen AD backend $(ad) is not a reverse mode AD. Use with caution."
@warn lazy"The chosen AD backend $(ad) is not a reverse mode AD. Use with caution."
end
if incompatible_backend_and_problem(prob, ad)
adₙ = select_reverse_mode_autodiff(prob, nothing; warn_check_mode)
@warn "The chosen AD backend `$(ad)` does not support the chosen problem. This \
@warn lazy"The chosen AD backend `$(ad)` does not support the chosen problem. This \
could be because the backend package for the chosen AD isn't loaded. After \
running autodiff selection detected `$(adₙ)` as a potential reverse mode \
backend."
Expand All @@ -75,7 +75,7 @@ end
function select_jacobian_autodiff(prob::AbstractNonlinearProblem, ad::AbstractADType)
if incompatible_backend_and_problem(prob, ad)
adₙ = select_jacobian_autodiff(prob, nothing)
@warn "The chosen AD backend `$(ad)` does not support the chosen problem. This \
@warn lazy"The chosen AD backend `$(ad)` does not support the chosen problem. This \
could be because the backend package for the chosen AD isn't loaded. After \
running autodiff selection detected `$(adₙ)` as a potential jacobian \
backend."
Expand Down
2 changes: 1 addition & 1 deletion lib/NonlinearSolveBase/src/descent/damped_newton.jl
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ function InternalAPI.solve!(
end
b = cache.Jᵀfu_cache
else
error("Unknown Mode: $(cache.mode).")
error(lazy"Unknown Mode: $(cache.mode).")
end
end

Expand Down
4 changes: 2 additions & 2 deletions lib/NonlinearSolveBase/src/jacobian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ function construct_concrete_adtype(f::NonlinearFunction, ad::AbstractADType)
else
if sparse_or_structured_prototype(f.jac_prototype)
if !(sparsity_detector isa NoSparsityDetector)
@warn "`jac_prototype` is a sparse matrix but sparsity = $(f.sparsity) \
@warn lazy"`jac_prototype` is a sparse matrix but sparsity = $(f.sparsity) \
has also been specified. Ignoring sparsity field and using \
`jac_prototype` sparsity."
end
Expand All @@ -248,7 +248,7 @@ function construct_concrete_adtype(f::NonlinearFunction, ad::AbstractADType)
end

function construct_concrete_adtype(::NonlinearFunction, ad::AutoSparse)
error("Specifying a sparse AD type for Nonlinear Problems was removed in v4. \
error(lazy"Specifying a sparse AD type for Nonlinear Problems was removed in v4. \
Instead use the `sparsity`, `jac_prototype`, and `colorvec` to specify \
the right sparsity pattern and coloring algorithm. Ignoring the sparsity \
detection algorithm and coloring algorithm present in $(ad).")
Expand Down
2 changes: 1 addition & 1 deletion lib/NonlinearSolveBase/src/linear_solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ fix_incompatible_linsolve_arguments(A, b, u) = u
fix_incompatible_linsolve_arguments(::SArray, ::SArray, u::SArray) = u
function fix_incompatible_linsolve_arguments(A, b, u::SArray)
(Core.Compiler.return_type(\, Tuple{typeof(A), typeof(b)}) <: typeof(u)) && return u
@warn "Solving Linear System A::$(typeof(A)) x::$(typeof(u)) = b::$(typeof(u)) is not \
@warn lazy"Solving Linear System A::$(typeof(A)) x::$(typeof(u)) = b::$(typeof(u)) is not \
properly supported. Converting `x` to a mutable array. Check the return type \
of the nonlinear function provided for optimal performance." maxlog=1
return MArray(u)
Expand Down
8 changes: 4 additions & 4 deletions lib/NonlinearSolveBase/src/polyalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ function Base.show(io::IO, ::MIME"text/plain", cache::NonlinearSolvePolyAlgorith
println(io, "NonlinearSolvePolyAlgorithmCache with \
$(Utils.unwrap_val(cache.static_length)) algorithms:")
best_alg = ifelse(cache.best == -1, "nothing", cache.best)
println(io, " Best Algorithm: $(best_alg)")
println(io, lazy" Best Algorithm: $(best_alg)")
println(
io, " Current Algorithm: [$(cache.current) / $(Utils.unwrap_val(cache.static_length))]"
io, lazy" Current Algorithm: [$(cache.current) / $(Utils.unwrap_val(cache.static_length))]"
)
println(io, " nsteps: $(cache.nsteps)")
println(io, " retcode: $(cache.retcode)")
println(io, lazy" nsteps: $(cache.nsteps)")
println(io, lazy" retcode: $(cache.retcode)")
print(io, " Current Cache: ")
NonlinearSolveBase.show_nonlinearsolve_cache(io, cache.caches[cache.current], 4)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/NonlinearSolveBase/src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ end

function Base.convert(::Type{AbstractArray}, A::Pinv)
hasmethod(pinv, Tuple{typeof(A.J)}) && return pinv(A.J)
@warn "`pinv` not defined for $(typeof(A.J)). Jacobian will not be inverted when \
@warn lazy"`pinv` not defined for $(typeof(A.J)). Jacobian will not be inverted when \
tracing." maxlog=1
return A.J
end
Expand Down
2 changes: 1 addition & 1 deletion lib/NonlinearSolveBase/src/wrappers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function assert_extension_supported_termination_condition(
no_termination_condition = termination_condition === nothing
no_termination_condition && return nothing
abs_norm_supported && termination_condition isa AbsNormTerminationMode && return nothing
throw(AssertionError("`$(nameof(typeof(alg)))` does not support termination conditions!"))
throw(AssertionError(lazy"`$(nameof(typeof(alg)))` does not support termination conditions!"))
end

function construct_extension_function_wrapper(
Expand Down
7 changes: 5 additions & 2 deletions lib/NonlinearSolveSciPy/src/NonlinearSolveSciPy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ function SciPyLeastSquares(; method::String = "trf", loss::String = "linear")
valid_methods = ("trf", "dogbox", "lm")
valid_losses = ("linear", "soft_l1", "huber", "cauchy", "arctan")
method in valid_methods ||
throw(ArgumentError("Invalid method: $method. Valid methods are: $(join(valid_methods, ", "))"))
throw(ArgumentError(
lazy"Invalid method: $method. Valid methods are: $(join(valid_methods, ", "))"))
loss in valid_losses ||
throw(ArgumentError("Invalid loss: $loss. Valid loss functions are: $(join(valid_losses, ", "))"))
throw(ArgumentError(
lazy"Invalid loss: $loss. Valid loss functions are: $(join(valid_losses, ",
"))"))
return SciPyLeastSquares(method, loss, :SciPyLeastSquares)
end

Expand Down
Loading