Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9844a99

Browse files
committedMay 21, 2024·
up
1 parent 6d88730 commit 9844a99

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

Diff for: ‎src/reaction.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ end
165165

166166
# Five-argument constructor accepting rate, substrates, and products, and their stoichiometries.
167167
function Reaction(rate, subs::Vector, prods::Vector, substoich::Vector{S}, prodstoich::Vector{T};
168-
netstoich = nothing, metadata = Pair{Symbol, Any}[],
168+
netstoich = [], metadata = Pair{Symbol, Any}[],
169169
only_use_rate = metadata_only_use_rate_check(metadata), kwargs...) where {S,T}
170170
# Error checks.
171171
isempty(subs) && isempty(prods) &&
@@ -189,12 +189,12 @@ function Reaction(rate, subs::Vector, prods::Vector, substoich::Vector{S}, prods
189189

190190
# Checks that all reactants are valid.
191191
if !(all(isvalidreactant, subs) && all(isvalidreactant, prods))
192-
badsts = union(filter(isvalidreactant, subs), filter(isvalidreactant, prods))
193-
throw(ArgumentError("""To be a valid substrate or product, non-constant species must be declared via @species, while constant species must be parameters with the isconstantspecies metadata. The following reactants do not follow this convention:\n $badsts"""))
192+
badsts = union(filter(!isvalidreactant, subs), filter(!isvalidreactant, prods))
193+
throw(ArgumentError("To be a valid substrate or product, non-constant species must be declared via @species, while constant species must be parameters with the isconstantspecies metadata. The following reactants do not follow this convention:\n $badsts"))
194194
end
195195

196196
# Computes the net stoichiometries.
197-
netstoich = if netstoich === nothing
197+
netstoich = if isnothing(netstoich)
198198
get_netstoich(subs, prods, substoich, prodstoich)
199199
else
200200
if typeof(netstoich) != Vector{Pair{BasicSymbolic{Real}, stoich_type}}

0 commit comments

Comments
 (0)
Please sign in to comment.