From 6aab793c17e6a6c3a3c7101b3687c4a5f156a070 Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Mon, 15 Jan 2024 10:23:16 -0500 Subject: [PATCH] Disable reinit on LSO cache --- docs/src/tutorials/optimizing_parameterized_ode.md | 1 - ext/NonlinearSolveLeastSquaresOptimExt.jl | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/src/tutorials/optimizing_parameterized_ode.md b/docs/src/tutorials/optimizing_parameterized_ode.md index efddaf7c1..d3b409eca 100644 --- a/docs/src/tutorials/optimizing_parameterized_ode.md +++ b/docs/src/tutorials/optimizing_parameterized_ode.md @@ -34,7 +34,6 @@ sol = solve(prob, Tsit5(); saveat = tsteps) # Plot the solution using Plots plot(sol; linewidth = 3) -savefig("LV_ode.png") ``` Let us now formulate the parameter estimation as a Nonlinear Least Squares Problem. diff --git a/ext/NonlinearSolveLeastSquaresOptimExt.jl b/ext/NonlinearSolveLeastSquaresOptimExt.jl index 0fa897dc1..6ce6eabd4 100644 --- a/ext/NonlinearSolveLeastSquaresOptimExt.jl +++ b/ext/NonlinearSolveLeastSquaresOptimExt.jl @@ -16,7 +16,6 @@ import LeastSquaresOptim as LSO end end -# TODO: Implement reinit @concrete struct LeastSquaresOptimJLCache prob alg @@ -24,6 +23,10 @@ end kwargs end +function SciMLBase.reinit!(cache::LeastSquaresOptimJLCache, args...; kwargs...) + error("Reinitialization not supported for LeastSquaresOptimJL.") +end + function SciMLBase.__init(prob::Union{NonlinearLeastSquaresProblem, NonlinearProblem}, alg::LeastSquaresOptimJL, args...; alias_u0 = false, abstol = nothing, show_trace::Val{ShT} = Val(false), trace_level = TraceMinimal(), reltol = nothing,