Skip to content

Commit

Permalink
fix: fix SII implementation for NonlinearSolveNoInitCache (#506)
Browse files Browse the repository at this point in the history
Co-authored-by: Christopher Rackauckas <[email protected]>
  • Loading branch information
AayushSabharwal and ChrisRackauckas authored Nov 18, 2024
1 parent 7f90cf4 commit 83f8c3d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/NonlinearSolveBase/src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ end
kwargs::Any
end

get_u(cache::NonlinearSolveNoInitCache) = SII.state_values(cache.prob)

function SciMLBase.reinit!(
cache::NonlinearSolveNoInitCache, u0 = cache.prob.u0; p = cache.prob.p, kwargs...
)
Expand Down
3 changes: 3 additions & 0 deletions test/mtk_cache_indexing_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
nint = init(nlprob, alg)
@test nint isa integtype

@test_nowarn state_values(nint)
@test_nowarn parameter_values(nint)

for (i, sym) in enumerate([X, nlsys.X, :X])
# test both getindex and setindex!
nint[sym] = 1.5i
Expand Down

0 comments on commit 83f8c3d

Please sign in to comment.