Unverified Commit 09bba8ed authored by St. Elmo's avatar St. Elmo
Browse files

fix

parent a0564590
......@@ -30,7 +30,7 @@ mutable struct CoreModel <: MetabolicModel
) where {V<:VecType,M<:MatType,K<:StringVecType}
all([length(b), length(mets)] .== size(S, 1)) ||
throw(DimensionMismatch("inconsistent number of reactions"))
throw(DimensionMismatch("inconsistent number of metabolites"))
all([length(c), length(xl), length(xu), length(rxns)] .== size(S, 2)) ||
throw(DimensionMismatch("inconsistent number of reactions"))
......
......@@ -108,6 +108,14 @@ function stoichiometry(model::StandardModel)::SparseMat
for (i, rxn_id) in enumerate(rxn_ids) # column, in order
for (met_id, coeff) in model.reactions[rxn_id].metabolites
j = findfirst(==(met_id), met_ids) # row
if isnothing(j)
throw(
DomainError(
met_id,
"Metabolite not found in model but occurs in stoichiometry of $(rxn_id). Perhaps it was deleted?",
),
)
end
S[j, i] = coeff
end
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment