From d837b1f8773af819ae23e85e3b1dbe0390f84971 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Wed, 13 Nov 2024 12:19:35 +0530 Subject: [PATCH] fix: fix SII implementation for caches --- lib/NonlinearSolveBase/src/abstract_types.jl | 2 +- lib/NonlinearSolveBase/src/polyalg.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/NonlinearSolveBase/src/abstract_types.jl b/lib/NonlinearSolveBase/src/abstract_types.jl index 6105f5125..6829e19c3 100644 --- a/lib/NonlinearSolveBase/src/abstract_types.jl +++ b/lib/NonlinearSolveBase/src/abstract_types.jl @@ -307,7 +307,7 @@ SciMLBase.isinplace(cache::AbstractNonlinearSolveCache) = SciMLBase.isinplace(ca ## SII Interface SII.symbolic_container(cache::AbstractNonlinearSolveCache) = cache.prob SII.parameter_values(cache::AbstractNonlinearSolveCache) = SII.parameter_values(cache.prob) -SII.state_values(cache::AbstractNonlinearSolveCache) = SII.state_values(cache.prob) +SII.state_values(cache::AbstractNonlinearSolveCache) = get_u(cache) function Base.getproperty(cache::AbstractNonlinearSolveCache, sym::Symbol) if sym === :ps diff --git a/lib/NonlinearSolveBase/src/polyalg.jl b/lib/NonlinearSolveBase/src/polyalg.jl index 54b61998f..76ba500dd 100644 --- a/lib/NonlinearSolveBase/src/polyalg.jl +++ b/lib/NonlinearSolveBase/src/polyalg.jl @@ -64,7 +64,7 @@ end function SII.symbolic_container(cache::NonlinearSolvePolyAlgorithmCache) return cache.caches[cache.current] end -SII.state_values(cache::NonlinearSolvePolyAlgorithmCache) = cache.u0 +SII.state_values(cache::NonlinearSolvePolyAlgorithmCache) = SII.state_values(SII.symbolic_container(cache)) function Base.show(io::IO, ::MIME"text/plain", cache::NonlinearSolvePolyAlgorithmCache) println(io, "NonlinearSolvePolyAlgorithmCache with \