Skip to content

Commit

Permalink
Disable reinit on LSO cache
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Jan 15, 2024
1 parent 1663669 commit 6aab793
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion docs/src/tutorials/optimizing_parameterized_ode.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 4 additions & 1 deletion ext/NonlinearSolveLeastSquaresOptimExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ import LeastSquaresOptim as LSO
end
end

# TODO: Implement reinit
@concrete struct LeastSquaresOptimJLCache
prob
alg
allocated_prob
kwargs
end

function SciMLBase.reinit!(cache::LeastSquaresOptimJLCache, args...; kwargs...)
error("Reinitialization not supported for LeastSquaresOptimJL.")

Check warning on line 27 in ext/NonlinearSolveLeastSquaresOptimExt.jl

View check run for this annotation

Codecov / codecov/patch

ext/NonlinearSolveLeastSquaresOptimExt.jl#L26-L27

Added lines #L26 - L27 were not covered by tests
end

function SciMLBase.__init(prob::Union{NonlinearLeastSquaresProblem, NonlinearProblem},

Check warning on line 30 in ext/NonlinearSolveLeastSquaresOptimExt.jl

View check run for this annotation

Codecov / codecov/patch

ext/NonlinearSolveLeastSquaresOptimExt.jl#L30

Added line #L30 was not covered by tests
alg::LeastSquaresOptimJL, args...; alias_u0 = false, abstol = nothing,
show_trace::Val{ShT} = Val(false), trace_level = TraceMinimal(), reltol = nothing,
Expand Down

0 comments on commit 6aab793

Please sign in to comment.