Skip to content

Commit 784f754

Browse files
committed
start on tests
1 parent 1e743a3 commit 784f754

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

src/reactionsystem_conversions.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ function classify_vrjs(rs, physcales)
336336
empty!(rxvars)
337337
(rx.rate isa Symbolic) && get_variables!(rxvars, rx.rate)
338338
@inbounds for rxvar in rxvars
339-
if isequal(rxvar, get_iv(rs))
339+
if isequal(rxvar, get_iv(rs)) || (!MT.isparameter(rxvar) && !isspecies(rxvar))
340340
isvrjvec[i] = true
341341
havevrjs = true
342342
break
@@ -401,7 +401,7 @@ function assemble_jumps(rs; combinatoric_ratelaws = true, physical_scales = noth
401401
end
402402
end
403403
end
404-
vcat(meqs, ceqs, veqs)
404+
reduce(vcat, (meqs, ceqs, veqs); init = Any[])
405405
end
406406

407407
### Equation Coupling ###

test/reactionsystem_core/reactionsystem.jl

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,4 +1021,18 @@ let
10211021
jprob = JumpProblem(jinput; rng)
10221022
sol = solve(jprob)
10231023
@test sol(10.0; idxs = :A) > 0
1024-
end
1024+
1025+
rn = @reaction_network begin
1026+
@parameters λ
1027+
k*V, 0 --> A
1028+
@equations D(V) ~ λ*V
1029+
@continuous_events begin
1030+
[V ~ 2.0] => [V ~ V/2, A ~ rand()*A]
1031+
end
1032+
end
1033+
jinput = JumpInputs(rn, [:A => 0, :V => 1.0], (0.0, 10.0), [:k => 1.0, => .2])
1034+
@test jinput.prob isa ODEProblem
1035+
jprob = JumpProblem(jinput; rng)
1036+
sol = solve(jprob, Tsit5())
1037+
1038+
end

0 commit comments

Comments
 (0)