Skip to content

Commit 88c4b56

Browse files
feat: forward getproperty on HomotopyNonlinearFunction to wrapped NonlinearFunction
1 parent 5850c7a commit 88c4b56

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/scimlfunctions.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4855,6 +4855,22 @@ function SymbolicIndexingInterface.observed(fn::HomotopyNonlinearFunction, sym::
48554855
SymbolicIndexingInterface.observed(symbolic_container(fn), sym)
48564856
end
48574857

4858+
function Base.getproperty(x::HomotopyNonlinearFunction, sym::Symbol)
4859+
if hasfield(HomotopyNonlinearFunction, sym)
4860+
return getfield(x, sym)
4861+
elseif hasfield(NonlinearFunction, sym)
4862+
return getfield(getfield(x, :f), sym)
4863+
elseif (sym == :initializeprob || sym == :update_initializeprob! ||
4864+
sym == :initializeprobmap || sym == :initializeprobpmap)
4865+
f = getfield(x, :f)
4866+
if f.initialization_data === nothing
4867+
return nothing
4868+
else
4869+
return getproperty(f.initialization_data, sym)
4870+
end
4871+
end
4872+
end
4873+
48584874
function Base.getproperty(x::AbstractSciMLFunction, sym::Symbol)
48594875
if __has_initialization_data(x) &&
48604876
(sym == :initializeprob || sym == :update_initializeprob! ||

0 commit comments

Comments
 (0)