Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
TorkelE committed May 22, 2024
1 parent 9844a99 commit 97b6842
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
13 changes: 5 additions & 8 deletions src/reaction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,11 @@ function Reaction(rate, subs::Vector, prods::Vector, substoich::Vector{S}, prods
end

# Computes the net stoichiometries.
netstoich = if isnothing(netstoich)
get_netstoich(subs, prods, substoich, prodstoich)
else
if typeof(netstoich) != Vector{Pair{BasicSymbolic{Real}, stoich_type}}
netstoich = Pair{BasicSymbolic{Real}, stoich_type}[
value(ns[1]) => convert(stoich_type, ns[2]) for ns in netstoich]
end
netstoich
if isempty(netstoich)
netstoich = get_netstoich(subs, prods, substoich, prodstoich)
elseif typeof(netstoich) != Vector{Pair{BasicSymbolic{Real}, stoich_type}}
netstoich = Pair{BasicSymbolic{Real}, stoich_type}[
value(ns[1]) => convert(stoich_type, ns[2]) for ns in netstoich]
end

# Handles metadata (check that all entries are unique, remove potential `only_use_rate`
Expand Down
1 change: 0 additions & 1 deletion test/reactionsystem_core/reactionsystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ end
### Check ODE, SDE, and Jump Functions ###

# Test by evaluating drift and diffusion terms.

let
u = rnd_u0(rs, rng)
p = rnd_ps(rs, rng)
Expand Down

0 comments on commit 97b6842

Please sign in to comment.