Skip to content

Commit 0598372

Browse files
committed
up
1 parent 096c8d6 commit 0598372

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/reaction.jl

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,11 @@ function Reaction(rate, subs::Vector, prods::Vector, substoich::Vector{S}, prods
194194
end
195195

196196
# Computes the net stoichiometries.
197-
netstoich = if isnothing(netstoich)
198-
get_netstoich(subs, prods, substoich, prodstoich)
199-
else
200-
if typeof(netstoich) != Vector{Pair{BasicSymbolic{Real}, stoich_type}}
201-
netstoich = Pair{BasicSymbolic{Real}, stoich_type}[
202-
value(ns[1]) => convert(stoich_type, ns[2]) for ns in netstoich]
203-
end
204-
netstoich
197+
if isempty(netstoich)
198+
netstoich = get_netstoich(subs, prods, substoich, prodstoich)
199+
elseif typeof(netstoich) != Vector{Pair{BasicSymbolic{Real}, stoich_type}}
200+
netstoich = Pair{BasicSymbolic{Real}, stoich_type}[
201+
value(ns[1]) => convert(stoich_type, ns[2]) for ns in netstoich]
205202
end
206203

207204
# Handles metadata (check that all entries are unique, remove potential `only_use_rate`

test/reactionsystem_core/reactionsystem.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ end
140140
### Check ODE, SDE, and Jump Functions ###
141141

142142
# Test by evaluating drift and diffusion terms.
143-
144143
let
145144
u = rnd_u0(rs, rng)
146145
p = rnd_ps(rs, rng)

0 commit comments

Comments
 (0)