Skip to content

Commit 9aabe56

Browse files
committed
- Added warning for when both stoichiometry vectors are nothing.
1 parent 7cb91dc commit 9aabe56

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/systems/reaction/reactionsystem.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ end
1111
function Reaction(rate, subs, prods, substoich, prodstoich;
1212
netstoich=nothing, only_use_rate=false, kwargs...)
1313

14-
(isnothing(prods)&&isnothing(subs)) && error("A reaction requires a non-nothing substrate or product vector.")
15-
if isnothing(subs)
14+
(isnothing(prods)&&isnothing(subs)) && error("A reaction requires a non-nothing substrate or product vector.")
15+
(isnothing(prodstoich)&&isnothing(substoich)) && error("Both substrate and product stochiometry inputs cannot be nothing.")
16+
if isnothing(subs)
1617
subs = Vector{Operation}()
1718
(substoich!=nothing) && error("If substrates are nothing, substrate stiocihometries have to be so too.")
1819
substoich = (prodstoich == nothing) ? nothing : typeof(prodstoich)()

0 commit comments

Comments
 (0)