Skip to content

Commit

Permalink
fix: fix SII implementation for NonlinearSolveNoInitCache
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Nov 18, 2024
1 parent 43e6b3d commit 73e381f
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 73e381f

Please sign in to comment.