Skip to content

Commit 9a3edfe

Browse files
refactor: add warning that substitute does not update events
1 parent 3ad212a commit 9a3edfe

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/systems/abstractsystem.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2113,6 +2113,10 @@ end
21132113

21142114
keytype(::Type{<:Pair{T, V}}) where {T, V} = T
21152115
function Symbolics.substitute(sys::AbstractSystem, rules::Union{Vector{<:Pair}, Dict})
2116+
if has_continuous_domain(sys) && get_continuous_events(sys) !== nothing ||
2117+
has_discrete_events(sys) && get_discrete_events(sys) !== nothing
2118+
@warn "`substitute` only supports performing substitutions in equations. This system has events, which will not be updated."
2119+
end
21162120
if keytype(eltype(rules)) <: Symbol
21172121
dict = todict(rules)
21182122
systems = get_systems(sys)

0 commit comments

Comments
 (0)