Skip to content
Snippets Groups Projects
Verified Commit f74280a4 authored by Laurent Heirendt's avatar Laurent Heirendt :airplane:
Browse files

use pkg relativity in test

parent 6e6b1097
No related branches found
No related tags found
No related merge requests found
......@@ -2,19 +2,19 @@
cp = test_simpleLP()
(lp, x) = flux_balance_analysis(cp, GLPK.Optimizer)
@test termination_status(lp) === MOI.OPTIMAL
sol = JuMP.value.(x)
sol = COBREXA.JuMP.value.(x)
@test sol [1.0, 2.0]
(lp, x) = flux_balance_analysis(cp, Clp.Optimizer)
@test termination_status(lp) === MOI.OPTIMAL
sol = JuMP.value.(x)
sol = COBREXA.JuMP.value.(x)
@test sol [1.0, 2.0]
# test the maximization of the objective
cp = test_simpleLP2()
(lp, x) = flux_balance_analysis(cp, GLPK.Optimizer)
@test termination_status(lp) === MOI.OPTIMAL
sol = JuMP.value.(x)
sol = COBREXA.JuMP.value.(x)
@test sol [-1.0, 2.0]
# test with a more biologically meaningfull model
......@@ -29,7 +29,7 @@
(lp, x) = flux_balance_analysis(cp, GLPK.Optimizer)
@test termination_status(lp) === MOI.OPTIMAL
sol = JuMP.value.(x)
sol = COBREXA.JuMP.value.(x)
@test objective_value(lp) expected_optimum
@test cp.c' * sol expected_optimum
......@@ -54,7 +54,7 @@ end
# FBA
biomass = findfirst(model.reactions, "BIOMASS_Ecoli_core_w_GAM")
cons = Dict("EX_glc__D_e" => (-12.0, -12.0))
optimizer = Tulip.Optimizer # quiet by default
optimizer = COBREXA.Tulip.Optimizer # quiet by default
sol = fba(model, optimizer; objective_func = biomass, constraints = cons)
pfl = findfirst(model.reactions, "PFL")
solmulti = fba(model, optimizer; objective_func = [biomass, pfl], weights = [0.8, 0.2]) # classic flux balance analysis
......
......@@ -74,7 +74,7 @@ end
pfl = findfirst(model.reactions, "PFL")
# FVA
optimizer = Tulip.Optimizer
optimizer = COBREXA.Tulip.Optimizer
atts = Dict("IPM_IterationsLimit" => 500)
cons = Dict("EX_glc__D_e" => (-10.0, -10.0))
fva_max, fva_min =
......
......@@ -27,7 +27,7 @@
) # just see if it works - OSQP is a terrible LP solver
sol = pfba(
model,
[Tulip.Optimizer, OSQP.Optimizer];
[COBREXA.Tulip.Optimizer, COBREXA.OSQP.Optimizer];
objective_func = biomass,
solver_attributes = Dict("opt1" => Dict{Any,Any}(), "opt2" => atts),
) # try two optimizers
......
......@@ -4,12 +4,12 @@
optimizer = GLPK.Optimizer
(lp, x) = optimize_model(cp, optimizer)
@test termination_status(lp) === MOI.OPTIMAL
sol = JuMP.value.(x)
sol = COBREXA.JuMP.value.(x)
@test sol [1.0, 2.0]
optimizer = Clp.Optimizer
(lp, x) = optimize_model(cp, optimizer)
@test termination_status(lp) === MOI.OPTIMAL
sol = JuMP.value.(x)
sol = COBREXA.JuMP.value.(x)
@test sol [1.0, 2.0]
end
......@@ -14,7 +14,6 @@ using OSQP
using Statistics
using JSON
using Measurements
using Downloads
function run_test_file(path...)
fn = joinpath(path...)
......@@ -42,7 +41,7 @@ function download_data_file(url, path, hash)
return path
end
Downloads.download(url, path)
COBREXA.Downloads.download(url, path)
check_data_file_hash(path, hash)
return path
end
......
......@@ -8,7 +8,7 @@
),
)
optimizer = Tulip.Optimizer
optimizer = COBREXA.Tulip.Optimizer
biomass = findfirst(model.reactions, "BIOMASS_Ecoli_core_w_GAM")
cons = Dict("EX_glc__D_e" => (-12.0, -12.0))
atts = Dict("IPM_IterationsLimit" => 110)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment