Skip to content

Commit

Permalink
feat: forward getproperty on HomotopyNonlinearFunction to wrapped…
Browse files Browse the repository at this point in the history
… `NonlinearFunction`
  • Loading branch information
AayushSabharwal committed Jan 3, 2025
1 parent 5850c7a commit 88c4b56
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/scimlfunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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! ||
Expand Down

0 comments on commit 88c4b56

Please sign in to comment.