Commit 977cafad authored by Mosè Giordano's avatar Mosè Giordano
Browse files

Turn some anonymous functions into proper named functions

parent 47d95132
......@@ -298,8 +298,8 @@ function extractModel(mdl::VPtr)::SBML.Model
for j = 1:ccall(sbml(:KineticLaw_getNumParameters), Cuint, (VPtr,), kl)
p = ccall(sbml(:KineticLaw_getParameter), VPtr, (VPtr, Cuint), kl, j - 1)
id = get_string(p, :Parameter_getId)
pval = () -> ccall(sbml(:Parameter_getValue), Cdouble, (VPtr,), p)
punit = () -> get_string(p, :Parameter_getUnits)
pval() = ccall(sbml(:Parameter_getValue), Cdouble, (VPtr,), p)
punit() = get_string(p, :Parameter_getUnits)
if id == "LOWER_BOUND"
lb = (pval(), punit())
elseif id == "UPPER_BOUND"
......
......@@ -51,10 +51,10 @@ end
@test length(getLBs(mdl)) == length(rxns)
@test length(getUBs(mdl)) == length(rxns)
getunit = (val, unit)::Tuple -> unit
getunit((val, unit)) = unit
@test all([broadcast(getunit, lbs) broadcast(getunit, ubs)] .== "mmol_per_gDW_per_hr")
getval = (val, unit)::Tuple -> val
getval((val, unit)) = val
lvals = broadcast(getval, lbs)
uvals = broadcast(getval, ubs)
@test isapprox(lvals[27], uvals[27])
......
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