You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
only_use_rate =metadata_only_use_rate_check(metadata), kwargs...) where {S,T}
170
+
# Error checks.
171
+
isempty(subs) &&isempty(prods) &&
172
+
throw(ArgumentError("A reaction requires either a non-empty substrate or product vector."))
173
+
length(subs) !=length(substoich) &&
174
+
throw(ArgumentError("The substrate vector ($(subs)) and the substrate stoichiometry vector ($(substoich)) must have equal length."))
175
+
length(prods) !=length(prodstoich) &&
176
+
throw(ArgumentError("The product vector ($(prods)) and the product stoichiometry vector ($(prodstoich)) must have equal length."))
180
177
allunique(subs) ||
181
178
throw(ArgumentError("Substrates can not be repeated in the list provided to `Reaction`, please modify the stoichiometry for any repeated substrates instead."))
182
-
S =eltype(substoich)
183
-
184
-
ifisnothing(prods)
185
-
prods =Vector{eltype(subs)}()
186
-
!isnothing(prodstoich) &&
187
-
throw(ArgumentError("If products are nothing, product stoichiometries have to be so too."))
188
-
prodstoich =typeof(substoich)()
189
-
else
190
-
prods =value.(prods)
191
-
end
192
179
allunique(prods) ||
193
180
throw(ArgumentError("Products can not be repeated in the list provided to `Reaction`, please modify the stoichiometry for any repeated products instead."))
194
-
T =eltype(prodstoich)
195
181
196
-
# try to get a common type for stoichiometry, using Any if have Syms
182
+
# Ensures everything have uniform and correct types.
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"""))
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"))
0 commit comments