Skip to content

Commit

Permalink
chore: fix QA testing
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Oct 22, 2024
1 parent 0b91de7 commit 89d76b0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
3 changes: 2 additions & 1 deletion lib/BracketingNonlinearSolve/test/qa_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ end
import ForwardDiff
using ExplicitImports, BracketingNonlinearSolve

@test check_no_implicit_imports(BracketingNonlinearSolve; skip = (Base, Core)) === nothing
@test check_no_implicit_imports(BracketingNonlinearSolve; skip = (Base, Core)) ===
nothing
@test check_no_stale_explicit_imports(BracketingNonlinearSolve) === nothing
@test check_all_qualified_accesses_via_owners(BracketingNonlinearSolve) === nothing
end
6 changes: 3 additions & 3 deletions src/NonlinearSolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ using LinearAlgebra: LinearAlgebra, ColumnNorm, Diagonal, I, LowerTriangular, Sy
UpperTriangular, axpy!, cond, diag, diagind, dot, issuccess, istril,
istriu, lu, mul!, norm, pinv, tril!, triu!
using LineSearch: LineSearch, AbstractLineSearchCache, LineSearchesJL, NoLineSearch,
RobustNonMonotoneLineSearch, BackTracking, LiFukushimaLineSearch
RobustNonMonotoneLineSearch, BackTracking, LiFukushimaLineSearch
using LinearSolve: LinearSolve, QRFactorization, needs_concrete_A, AbstractFactorization,
DefaultAlgorithmChoice, DefaultLinearSolver
using MaybeInplace: @bb
using NonlinearSolveBase: NonlinearSolveBase, nonlinearsolve_forwarddiff_solve,
nonlinearsolve_dual_solution, nonlinearsolve_∂f_∂p,
nonlinearsolve_∂f_∂u, L2_NORM, AbstractNonlinearTerminationMode,
AbstractSafeNonlinearTerminationMode,
nonlinearsolve_∂f_∂u, L2_NORM, AbsNormTerminationMode,
AbstractNonlinearTerminationMode,
AbstractSafeBestNonlinearTerminationMode
using Printf: @printf
using Preferences: Preferences, @load_preference, @set_preferences!
Expand Down
3 changes: 2 additions & 1 deletion src/abstract_types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ Abstract Type for all Approximate Jacobian Update Rules used in NonlinearSolve.j
```julia
__internal_init(
prob::AbstractNonlinearProblem, alg::AbstractApproximateJacobianUpdateRule, J, fu, u,
du, args...; internalnorm::F = L2_NORM, kwargs...) where {F} --> AbstractApproximateJacobianUpdateRuleCache{INV}
du, args...; internalnorm::F = L2_NORM, kwargs...) where {F} -->
AbstractApproximateJacobianUpdateRuleCache{INV}
```
"""
abstract type AbstractApproximateJacobianUpdateRule{INV} end
Expand Down
17 changes: 12 additions & 5 deletions test/core/rootfind_tests.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@testsetup module CoreRootfindTesting
using Reexport
@reexport using BenchmarkTools, LinearSolve, NonlinearSolve, StaticArrays, Random,
LinearAlgebra, ForwardDiff, Zygote, Enzyme, DiffEqBase,
SparseConnectivityTracer
LinearAlgebra, ForwardDiff, Zygote, Enzyme, SparseConnectivityTracer,
NonlinearSolveBase
using LineSearches: LineSearches

_nameof(x) = applicable(nameof, x) ? nameof(x) : _nameof(typeof(x))
Expand All @@ -22,9 +22,16 @@ function newton_fails(u, p)
end

const TERMINATION_CONDITIONS = [
NormTerminationMode(), RelTerminationMode(), RelNormTerminationMode(),
AbsTerminationMode(), AbsNormTerminationMode(), RelSafeTerminationMode(),
AbsSafeTerminationMode(), RelSafeBestTerminationMode(), AbsSafeBestTerminationMode()]
NormTerminationMode(Base.Fix1(maximum, abs)),
RelTerminationMode(),
RelNormTerminationMode(Base.Fix1(maximum, abs)),
RelNormSafeTerminationMode(Base.Fix1(maximum, abs)),
RelNormSafeBestTerminationMode(Base.Fix1(maximum, abs)),
AbsTerminationMode(),
AbsNormTerminationMode(Base.Fix1(maximum, abs)),
AbsNormSafeTerminationMode(Base.Fix1(maximum, abs)),
AbsNormSafeBestTerminationMode(Base.Fix1(maximum, abs))
]

function benchmark_nlsolve_oop(f, u0, p = 2.0; solver, kwargs...)
prob = NonlinearProblem{false}(f, u0, p)
Expand Down

0 comments on commit 89d76b0

Please sign in to comment.