Skip to content

Commit 58a6e4f

Browse files
committed
prepare error messages in sde sims
1 parent 1b81a6b commit 58a6e4f

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

test/model_simulation/simulate_SDEs.jl

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,18 @@ let
300300
ps = [:p => 1000.0, :d => 1.0, :η1 => 1.0, :η2 => 1.4, :η3 => 0.33, :η4 => 4.0]
301301
sprob = SDEProblem(noise_scaling_network, u0, (0.0, 1000.0), ps)
302302

303+
# Test have at some point failed due to StochasticDiffEq failing to initiate. This temporary extra
304+
# check is in place if it will happen again, to help us investigate.
303305
for repeat in 1:5
304-
sol = solve(sprob, ImplicitEM(); saveat = 1.0, adaptive = false, dt = 0.01, seed = rand(rng, 1:100))
305-
SciMLBase.successful_retcode(sol) || continue
306-
@test var(sol[:X1]) > var(sol[:X2]) > var(sol[:X3]) > var(sol[:X4]) > var(sol[:X5])
306+
seed = rand(rng, 1:100)
307+
sol = solve(sprob, ImplicitEM(); seed, saveat = 1.0, adaptive = false, dt = 0.01)
308+
if SciMLBase.successful_retcode(sol)
309+
@test var(sol[:X1]) > var(sol[:X2]) > var(sol[:X3]) > var(sol[:X4]) > var(sol[:X5])
310+
else
311+
println("Problem with SDE simulation test (fails but should not).")
312+
println("Seed: $seed")
313+
println("Retcode: $(sol.retcode)")
314+
end
307315
end
308316
end
309317

0 commit comments

Comments
 (0)