From a3f11c62104302f110bc08afd9394bd7505af50f Mon Sep 17 00:00:00 2001 From: Max Opgenoord <218280891+mx-p9a@users.noreply.github.com> Date: Wed, 11 Feb 2026 15:55:03 -0800 Subject: [PATCH 1/2] Remove unused dependency --- Project.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/Project.toml b/Project.toml index b13fde4..434b0ed 100644 --- a/Project.toml +++ b/Project.toml @@ -5,7 +5,6 @@ version = "1.1.0" [deps] ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" -DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63" ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" @@ -18,7 +17,6 @@ PyCallExt = "PythonCall" [compat] ChainRulesCore = "1.15" -DifferentiationInterface = "0.6" ForwardDiff = "0.10.30, 1" PythonCall = "0.9.28" ReverseDiff = "1.14" From e01786708be74ce700ffedf9087a658b7ea67019 Mon Sep 17 00:00:00 2001 From: Max Opgenoord <218280891+mx-p9a@users.noreply.github.com> Date: Thu, 12 Feb 2026 13:51:08 -0800 Subject: [PATCH 2/2] Fix NLsolve SubArray/Vector type mismatch with DI 0.7 NLsolve with autodiff=:forward now uses DifferentiationInterface internally, which has strict type checks in v0.7. When yprev is a SubArray (column view from odesolve), DI's preparation fails with a PreparationMismatchError. Convert to Vector before passing to nlsolve. --- docs/src/tutorial.md | 2 +- test/runtests.jl | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/src/tutorial.md b/docs/src/tutorial.md index a5d6784..9a88295 100644 --- a/docs/src/tutorial.md +++ b/docs/src/tutorial.md @@ -417,7 +417,7 @@ To solve these sets of residuals, we use the default trust-region method in NLso ```@example implicit function onestep!(y, yprev, t, tprev, xd, xci, p) f!(r, yt) = residual!(r, yt, yprev, t, tprev, xd, xci, p) - sol = nlsolve(f!, yprev, autodiff=:forward, ftol=1e-12) + sol = nlsolve(f!, Vector(yprev), autodiff=:forward, ftol=1e-12) y .= sol.zero return nothing end diff --git a/test/runtests.jl b/test/runtests.jl index ae9ef6d..2942373 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -719,7 +719,7 @@ end function onestep(yprev, t, tprev, xd, xci, p) f(yt) = residual(yt, yprev, t, tprev, xd, xci, p) - sol = nlsolve(f, yprev, autodiff=:forward, ftol=1e-12) + sol = nlsolve(f, Vector(yprev), autodiff=:forward, ftol=1e-12) return sol.zero end @@ -777,7 +777,7 @@ end function onestep!(y, yprev, t, tprev, xd, xci, p) f!(r, yt) = residual!(r, yt, yprev, t, tprev, xd, xci, p) - sol = nlsolve(f!, yprev, autodiff=:forward, ftol=1e-12) + sol = nlsolve(f!, Vector(yprev), autodiff=:forward, ftol=1e-12) y .= sol.zero return nothing end @@ -1115,4 +1115,4 @@ end vjp(xbar, x, fbar) @test all(isapprox.(xbar, J' * fbar, rtol=1e-15)) -end \ No newline at end of file +end