From 88c4b560d393ff62ab26f581d73cceca68934acc Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Fri, 3 Jan 2025 11:30:49 +0530 Subject: [PATCH] feat: forward `getproperty` on `HomotopyNonlinearFunction` to wrapped `NonlinearFunction` --- src/scimlfunctions.jl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/scimlfunctions.jl b/src/scimlfunctions.jl index 8f103ed00..7b247b5bc 100644 --- a/src/scimlfunctions.jl +++ b/src/scimlfunctions.jl @@ -4855,6 +4855,22 @@ function SymbolicIndexingInterface.observed(fn::HomotopyNonlinearFunction, sym:: SymbolicIndexingInterface.observed(symbolic_container(fn), sym) end +function Base.getproperty(x::HomotopyNonlinearFunction, sym::Symbol) + if hasfield(HomotopyNonlinearFunction, sym) + return getfield(x, sym) + elseif hasfield(NonlinearFunction, sym) + return getfield(getfield(x, :f), sym) + elseif (sym == :initializeprob || sym == :update_initializeprob! || + sym == :initializeprobmap || sym == :initializeprobpmap) + f = getfield(x, :f) + if f.initialization_data === nothing + return nothing + else + return getproperty(f.initialization_data, sym) + end + end +end + function Base.getproperty(x::AbstractSciMLFunction, sym::Symbol) if __has_initialization_data(x) && (sym == :initializeprob || sym == :update_initializeprob! ||