From f74280a410bf5b4cd50f36f29e8e56e0e35b0e21 Mon Sep 17 00:00:00 2001 From: laurentheirendt <laurent.heirendt@uni.lu> Date: Thu, 1 Apr 2021 11:20:21 +0200 Subject: [PATCH] use pkg relativity in test --- test/analysis/fba.jl | 10 +++++----- test/analysis/fva.jl | 2 +- test/analysis/pfba.jl | 2 +- test/base/solver.jl | 4 ++-- test/runtests.jl | 3 +-- test/sampling/sampling_tools_test.jl | 2 +- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/test/analysis/fba.jl b/test/analysis/fba.jl index 4e92b0c53..3aecc1f11 100644 --- a/test/analysis/fba.jl +++ b/test/analysis/fba.jl @@ -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 diff --git a/test/analysis/fva.jl b/test/analysis/fva.jl index 671e66da3..8c555dc8c 100644 --- a/test/analysis/fva.jl +++ b/test/analysis/fva.jl @@ -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 = diff --git a/test/analysis/pfba.jl b/test/analysis/pfba.jl index 4d9987a52..fffd674fe 100644 --- a/test/analysis/pfba.jl +++ b/test/analysis/pfba.jl @@ -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 diff --git a/test/base/solver.jl b/test/base/solver.jl index 3208c7e9f..bcfce612d 100644 --- a/test/base/solver.jl +++ b/test/base/solver.jl @@ -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 diff --git a/test/runtests.jl b/test/runtests.jl index 5baeae3e3..e3811f527 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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 diff --git a/test/sampling/sampling_tools_test.jl b/test/sampling/sampling_tools_test.jl index 0886946fa..92611296b 100644 --- a/test/sampling/sampling_tools_test.jl +++ b/test/sampling/sampling_tools_test.jl @@ -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) -- GitLab