Skip to content

Commit

Permalink
Merge pull request #1038 from isaacsas/fix_tests
Browse files Browse the repository at this point in the history
Fix tests
  • Loading branch information
ChrisRackauckas authored Sep 1, 2024
2 parents 6b39560 + 2ef14da commit 7e97133
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/dsl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ macro reaction_network(name::Expr, ex::Expr)
MacroTools.striplines(ex); name = :($(esc(name.args[1])))))))
end

macro reaction_network(ex::Expr)
macro reaction_network(ex::Expr)
ex = MacroTools.striplines(ex)

# no name but equations: @reaction_network begin ... end ...
Expand Down
13 changes: 5 additions & 8 deletions test/reactionsystem_core/events.jl
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ let
@parameters e1=0 e2=0 e3=0
@discrete_events begin
[1.0] => [e1 ~ 1]
# 1.0 => [e2 ~ 1]
1.0 => [e2 ~ 1]
(X > 1000.0) & (e3==0) => [e3 ~ 1]
end
(p,d), 0 <--> X
Expand All @@ -363,9 +363,8 @@ let
sol = solve(jprob, SSAStepper(); seed)

# Checks that all `e` parameters have been updated properly.
# Note that periodic discrete events are currently broken for jump processes (and unlikely to be fixed soon due to periodic callbacks using the internals of ODE integrator and Datastructures heap implementations).
@test sol.ps[:e1] == 1
@test_broken sol.ps[:e2] == 1 # (https://github.com/SciML/JumpProcesses.jl/issues/417)
@test sol.ps[:e2] == 1
@test sol.ps[:e3] == 1
end

Expand Down Expand Up @@ -440,8 +439,6 @@ let
jprob = JumpProblem(rn, dprob, Direct(); rng)
jprob_events = JumpProblem(rn_dics_events, dprob_events, Direct(); rng)
sol = solve(jprob, SSAStepper(); seed, callback)
@test_broken let # (https://github.com/SciML/JumpProcesses.jl/issues/417)
sol_events = solve(jprob_events, SSAStepper(); seed)
@test sol == sol_events
end
end
sol_events = solve(jprob_events, SSAStepper(); seed)
@test_broken sol == sol_events # seems to be not identical in the sample paths
end

0 comments on commit 7e97133

Please sign in to comment.