Skip to content

Commit 280b8d4

Browse files
committed
fix: remove deprecated APIs
1 parent c73bcf4 commit 280b8d4

File tree

3 files changed

+15
-48
lines changed

3 files changed

+15
-48
lines changed

docs/src/basics/sparsity_detection.md

-19
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,3 @@ prob = NonlinearProblem(
7676

7777
Refer to the documentation of DifferentiationInterface.jl and SparseConnectivityTracer.jl
7878
for more information on sparsity detection algorithms.
79-
80-
## Case III: Sparse AD Type is being Used
81-
82-
!!! warning
83-
84-
This is now deprecated. Please use the previous two cases instead.
85-
86-
If you constructed a Nonlinear Solver with a sparse AD type, for example
87-
88-
```julia
89-
NewtonRaphson(; autodiff = AutoSparse(AutoForwardDiff()))
90-
# OR
91-
TrustRegion(; autodiff = AutoSparse(AutoZygote()))
92-
```
93-
94-
then NonlinearSolve will automatically perform matrix coloring and use sparse
95-
differentiation if none of `sparsity` or `jac_prototype` is provided. We default to using
96-
`TracerSparsityDetector()`. `Case I/II` take precedence for sparsity detection and we
97-
perform sparse AD based on those options if those are provided.

docs/src/basics/termination_condition.md

-15
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,3 @@ not used as a default anywhere.
5454
```@docs
5555
SimpleNonlinearSolveTerminationMode
5656
```
57-
58-
### Return Codes (Deprecated)
59-
60-
These are deprecated and will be removed in a future release. Use the
61-
`use_deprecated_retcodes = Val(false)` option to `SciMLBase.init` to use the new return
62-
`ReturnCode` versions.
63-
64-
```@docs
65-
DiffEqBase.NonlinearSafeTerminationReturnCode
66-
DiffEqBase.NonlinearSafeTerminationReturnCode.Success
67-
DiffEqBase.NonlinearSafeTerminationReturnCode.Default
68-
DiffEqBase.NonlinearSafeTerminationReturnCode.Failure
69-
DiffEqBase.NonlinearSafeTerminationReturnCode.PatienceTermination
70-
DiffEqBase.NonlinearSafeTerminationReturnCode.ProtectiveTermination
71-
```

test/core/rootfind_tests.jl

+15-14
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
@testsetup module CoreRootfindTesting
22
using Reexport
33
@reexport using BenchmarkTools, LinearSolve, NonlinearSolve, StaticArrays, Random,
4-
LinearAlgebra, ForwardDiff, Zygote, Enzyme, DiffEqBase
4+
LinearAlgebra, ForwardDiff, Zygote, Enzyme, DiffEqBase,
5+
SparseConnectivityTracer
56
using LineSearches: LineSearches
67

78
_nameof(x) = applicable(nameof, x) ? nameof(x) : _nameof(typeof(x))
@@ -116,12 +117,12 @@ end
116117
@test nlprob_iterator_interface(quadratic_f, p, Val(false), NewtonRaphson()) sqrt.(p)
117118
@test nlprob_iterator_interface(quadratic_f!, p, Val(true), NewtonRaphson()) sqrt.(p)
118119

119-
@testset "ADType: $(autodiff) u0: $(_nameof(u0))" for autodiff in (
120-
AutoSparse(AutoForwardDiff()), AutoSparse(AutoFiniteDiff()),
121-
AutoZygote(), AutoSparse(AutoZygote()), AutoSparse(AutoEnzyme())),
120+
@testset "Sparsity ADType: $(autodiff) u0: $(_nameof(u0))" for autodiff in (
121+
AutoForwardDiff(), AutoFiniteDiff(), AutoZygote(), AutoEnzyme()),
122122
u0 in (1.0, [1.0, 1.0])
123123

124-
probN = NonlinearProblem(quadratic_f, u0, 2.0)
124+
probN = NonlinearProblem(
125+
NonlinearFunction(quadratic_f; sparsity = TracerSparsityDetector()), u0, 2.0)
125126
@test all(solve(probN, NewtonRaphson(; autodiff)).u .≈ sqrt(2.0))
126127
end
127128

@@ -180,12 +181,12 @@ end
180181
@test nlprob_iterator_interface(quadratic_f!, p, Val(true), TrustRegion()) sqrt.(p)
181182

182183
@testset "$(_nameof(autodiff)) u0: $(_nameof(u0)) $(radius_update_scheme)" for autodiff in (
183-
AutoSparse(AutoForwardDiff()), AutoSparse(AutoFiniteDiff()),
184-
AutoZygote(), AutoSparse(AutoZygote()), AutoSparse(AutoEnzyme())),
184+
AutoForwardDiff(), AutoFiniteDiff(), AutoZygote(), AutoEnzyme()),
185185
u0 in (1.0, [1.0, 1.0]),
186186
radius_update_scheme in radius_update_schemes
187187

188-
probN = NonlinearProblem(quadratic_f, u0, 2.0)
188+
probN = NonlinearProblem(
189+
NonlinearFunction(quadratic_f; sparsity = TracerSparsityDetector()), u0, 2.0)
189190
@test all(solve(probN, TrustRegion(; autodiff, radius_update_scheme)).u .≈
190191
sqrt(2.0))
191192
end
@@ -276,11 +277,11 @@ end
276277
end
277278

278279
@testset "ADType: $(autodiff) u0: $(_nameof(u0))" for autodiff in (
279-
AutoSparse(AutoForwardDiff()), AutoSparse(AutoFiniteDiff()),
280-
AutoZygote(), AutoSparse(AutoZygote()), AutoSparse(AutoEnzyme())),
280+
AutoForwardDiff(), AutoFiniteDiff(), AutoZygote(), AutoEnzyme()),
281281
u0 in (1.0, [1.0, 1.0])
282282

283-
probN = NonlinearProblem(quadratic_f, u0, 2.0)
283+
probN = NonlinearProblem(
284+
NonlinearFunction(quadratic_f; sparsity = TracerSparsityDetector()), u0, 2.0)
284285
@test all(solve(
285286
probN, LevenbergMarquardt(; autodiff); abstol = 1e-9, reltol = 1e-9).u .≈
286287
sqrt(2.0))
@@ -458,11 +459,11 @@ end
458459
quadratic_f!, p, Val(true), PseudoTransient(; alpha_initial = 10.0)) sqrt.(p)
459460

460461
@testset "ADType: $(autodiff) u0: $(_nameof(u0))" for autodiff in (
461-
AutoSparse(AutoForwardDiff()), AutoSparse(AutoFiniteDiff()),
462-
AutoZygote(), AutoSparse(AutoZygote()), AutoSparse(AutoEnzyme())),
462+
AutoForwardDiff(), AutoFiniteDiff(), AutoZygote(), AutoEnzyme()),
463463
u0 in (1.0, [1.0, 1.0])
464464

465-
probN = NonlinearProblem(quadratic_f, u0, 2.0)
465+
probN = NonlinearProblem(
466+
NonlinearFunction(quadratic_f; sparsity = TracerSparsityDetector()), u0, 2.0)
466467
@test all(solve(probN, PseudoTransient(; alpha_initial = 10.0, autodiff)).u .≈
467468
sqrt(2.0))
468469
end

0 commit comments

Comments
 (0)