Skip to content

Commit

Permalink
add a big warning on mutation of ODEProblem
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Sep 22, 2023
1 parent bb384b3 commit 97517dd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/problems/ode_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,16 @@ mutable struct ODEProblem{uType, tType, isinplace, P, F, K, PT} <:
end
TruncatedStacktraces.@truncate_stacktrace ODEProblem 3 1 2

function Base.setproperty!(prob::ODEProblem, s::Symbol, v)
@warn "Mutation of ODEProblem detected. SciMLBase v2.0 has made ODEProblem temporarily mutable in order to allow for interfacing with EnzymeRules due to a current limitation in the rule system. This change is only intended to be temporary and ODEProblem will return to being a struct in a later non-breaking release. Do not rely on this behavior, use with caution."
Base.setfield!(prob, s, v)
end

function Base.setproperty!(prob::ODEProblem, s::Symbol, v, order::Symbol)
@warn "Mutation of ODEProblem detected. SciMLBase v2.0 has made ODEProblem temporarily mutable in order to allow for interfacing with EnzymeRules due to a current limitation in the rule system. This change is only intended to be temporary and ODEProblem will return to being a struct in a later non-breaking release. Do not rely on this behavior, use with caution."
Base.setfield!(prob, s, v, order)
end

"""
ODEProblem(f::ODEFunction,u0,tspan,p=NullParameters(),callback=CallbackSet())
Expand Down

0 comments on commit 97517dd

Please sign in to comment.