Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests #1038

Merged
merged 3 commits into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading