Skip to content

Commit bb4ef14

Browse files
committed
fix: use is_diff_equation instead of isdiffeq when finding algeeqs
1 parent 5c25416 commit bb4ef14

File tree

5 files changed

+4
-8
lines changed

5 files changed

+4
-8
lines changed

src/systems/callbacks.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@ function make_affect(affect::Vector{Equation}; iv = nothing, algeeqs::Vector{Equ
295295
for u in dvs
296296
aff_map[u] = u
297297
end
298-
@show explicit
299298

300299
AffectSystem(affectsys, collect(dvs), params, discretes, aff_map, explicit)
301300
end
@@ -842,7 +841,6 @@ Compile an affect defined by a set of equations. Systems with algebraic equation
842841
function compile_equational_affect(aff::Union{AffectSystem, Vector{Equation}}, sys; reset_jumps = false, kwargs...)
843842
if aff isa AbstractVector
844843
aff = make_affect(aff; iv = get_iv(sys))
845-
@show is_explicit(aff)
846844
end
847845
affsys = system(aff)
848846
ps_to_update = discretes(aff)

src/systems/diffeqs/odesystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ function ODESystem(deqs::AbstractVector{<:Equation}, iv, dvs, ps;
305305
throw(ArgumentError("System names must be unique."))
306306
end
307307

308-
algeeqs = filter(eq -> eq.lhs isa Union{Symbolic, Number} && !isdiffeq(eq), deqs)
308+
algeeqs = filter(eq -> eq.lhs isa Union{Symbolic, Number} && !is_diff_equation(eq), deqs)
309309
cont_callbacks = SymbolicContinuousCallbacks(continuous_events; algeeqs, iv)
310310
disc_callbacks = SymbolicDiscreteCallbacks(discrete_events; algeeqs, iv)
311311

src/systems/diffeqs/sdesystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ function SDESystem(deqs::AbstractVector{<:Equation}, neqs::AbstractArray, iv, dv
264264
Wfact = RefValue(EMPTY_JAC)
265265
Wfact_t = RefValue(EMPTY_JAC)
266266

267-
algeeqs = filter(eq -> eq.lhs isa Union{Symbolic, Number} && !isdiffeq(eq), deqs)
267+
algeeqs = filter(eq -> eq.lhs isa Union{Symbolic, Number} && !is_diff_equation(eq), deqs)
268268
cont_callbacks = SymbolicContinuousCallbacks(continuous_events; algeeqs, iv)
269269
disc_callbacks = SymbolicDiscreteCallbacks(discrete_events; algeeqs, iv)
270270
if is_dde === nothing

src/systems/model_parsing.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,6 @@ function parse_equations!(exprs, eqs, dict, body)
11151115
end
11161116

11171117
function parse_continuous_events!(c_evts, dict, body)
1118-
@show body
11191118
dict[:continuous_events] = []
11201119
Base.remove_linenums!(body)
11211120
for arg in body.args
@@ -1125,7 +1124,6 @@ function parse_continuous_events!(c_evts, dict, body)
11251124
end
11261125

11271126
function parse_discrete_events!(d_evts, dict, body)
1128-
@show body
11291127
dict[:discrete_events] = []
11301128
Base.remove_linenums!(body)
11311129
for arg in body.args

test/initializationsystem.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,9 +1280,9 @@ end
12801280
@parameters β γ S0
12811281
@variables S(t)=S0 I(t) R(t)
12821282
rate₁ = β * S * I
1283-
affect₁ = [S ~ S - 1, I ~ I + 1]
1283+
affect₁ = [S ~ Pre(S) - 1, I ~ Pre(I) + 1]
12841284
rate₂ = γ * I
1285-
affect₂ = [I ~ I - 1, R ~ R + 1]
1285+
affect₂ = [I ~ Pre(I) - 1, R ~ Pre(R) + 1]
12861286
j₁ = ConstantRateJump(rate₁, affect₁)
12871287
j₂ = ConstantRateJump(rate₂, affect₂)
12881288
j₃ = MassActionJump(2 * β + γ, [R => 1], [S => 1, R => -1])

0 commit comments

Comments
 (0)