Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 93d3b5b

Browse files
committed
feat: update to new DI.jl
1 parent c48ef4f commit 93d3b5b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SimpleNonlinearSolve"
22
uuid = "727e6d20-b764-4bd8-a329-72de5adea6c7"
33
authors = ["SciML"]
4-
version = "1.12.2"
4+
version = "1.12.3"
55

66
[deps]
77
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
@@ -43,7 +43,7 @@ ChainRulesCore = "1.23"
4343
ConcreteStructs = "0.2.3"
4444
DiffEqBase = "6.149"
4545
DiffResults = "1.1"
46-
DifferentiationInterface = "0.5"
46+
DifferentiationInterface = "0.6"
4747
ExplicitImports = "1.5.0"
4848
FastClosures = "0.3.2"
4949
FiniteDiff = "2.23.1"

src/utils.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ end
2828

2929
function value_and_jacobian(
3030
ad, prob::AbstractNonlinearProblem, f::F, y, x, cache; J = nothing) where {F}
31-
x isa Number && return DI.value_and_derivative(f, ad, x, cache)
31+
x isa Number && return DI.value_and_derivative(f, cache, ad, x)
3232

3333
if isinplace(prob)
3434
if cache isa HasAnalyticJacobian
3535
prob.f.jac(J, x, prob.p)
3636
f(y, x)
3737
return y, J
3838
end
39-
return DI.value_and_jacobian!(f, y, J, ad, x, cache)
39+
return DI.value_and_jacobian!(f, y, J, cache, ad, x)
4040
else
4141
cache isa HasAnalyticJacobian && return f(x), prob.f.jac(x, prob.p)
42-
J === nothing && return DI.value_and_jacobian(f, ad, x, cache)
43-
y, J = DI.value_and_jacobian!(f, J, ad, x, cache)
42+
J === nothing && return DI.value_and_jacobian(f, cache, ad, x)
43+
y, J = DI.value_and_jacobian!(f, J, cache, ad, x)
4444
return y, J
4545
end
4646
end

0 commit comments

Comments
 (0)