Skip to content

Commit e8c41f4

Browse files
Merge pull request #56 from opencobra/develop
Regular merge of develop
2 parents b043686 + caacf06 commit e8c41f4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+576
-476
lines changed

.artenolis.yml

+21-14
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,45 @@ script:
1010

1111
# add MATLAB to the path
1212
- if [ "$ARCH" == "Linux" ]; then
13-
export PATH="/mnt/prince-data/MATLAB/$MATLAB_VER/bin:$PATH";
13+
export PATH="$PATH:$ARTENOLIS_SOFT_PATH/MATLAB/$MATLAB_VER/bin";
1414
fi
1515

16-
# clone the COBRA Toolbox
17-
- rm -rf /tmp/cobratoolbox-cobrajl
18-
- git clone https://github.com/opencobra/cobratoolbox.git /tmp/cobratoolbox-cobrajl --depth=1
19-
- cd /tmp/cobratoolbox-cobrajl
20-
- git submodule update --init --remote --no-fetch --depth=1
21-
2216
# change to the current directory
2317
- cd $CURRENT_DIR
2418

2519
# rename the cloned folder
2620
- cd .. && cp -r $NODE_LABELS COBRA && cd COBRA
2721

22+
# change the test dependencies on Linux and macOS (ARTENOLIS)
23+
- if [ "$ARCH" == "Linux" ] || [ "$ARCH" == "macOS" ]; then
24+
CURRENT_DIR=`pwd`;
25+
cd ~/tmp/cobratoolbox-cobrajl;
26+
git pull origin master;
27+
cd $CURRENT_DIR;
28+
perl -i -pe's/test = \["GLPKMathProgInterface", "GLPK", "Test"\]/test = \["GLPKMathProgInterface", "GLPK", "Test", "MAT", "MATLAB", "Gurobi", "CPLEX"\]/g' Project.toml;
29+
fi
30+
2831
# launch the tests
2932
- bash .artenolis/runtests.sh
3033

31-
# clean up the build directory
32-
- cd .. && rm -rf COBRA
33-
3434
after_success:
35-
- if [ "$ARCH" == "Linux" ]; then /mnt/prince-data/JULIA/$JULIA_VER/bin/julia --color=yes -e 'cd(Pkg.dir("COBRA")); using Coverage; tmp=process_folder(); Codecov.submit(tmp, verbose=false); Coveralls.submit(tmp);'; fi
35+
36+
# submit coverage report
37+
- if [[ "$ARCH" == "Linux" && "$JULIA_VER" == "v1.2.0" ]]; then
38+
$ARTENOLIS_SOFT_PATH/julia/$JULIA_VER/bin/julia --color=yes -e 'import Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())';
39+
fi
3640

3741
# set environment variables for documentation deployment
38-
- if [ "$ARCH" == "Linux" ]; then
42+
- if [[ "$ARCH" == "Linux" && "$JENKINS_PULL_REQUEST" != "True" ]]; then
3943
export TRAVIS_BRANCH=$GIT_BRANCH;
4044
export TRAVIS_PULL_REQUEST=false;
4145
var=$GIT_URL; export TRAVIS_REPO_SLUG=${var:7:${#var}};
4246
export TRAVIS_OS_NAME=$label;
4347
export TRAVIS_JULIA_VERSION=$JULIA_VER;
48+
$ARTENOLIS_SOFT_PATH/julia/$JULIA_VER/bin/julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()';
49+
$ARTENOLIS_SOFT_PATH/julia/$JULIA_VER/bin/julia --project=docs/ docs/make.jl;
4450
fi
4551

46-
# deploy documentation
47-
- if [ "$ARCH" == "Linux" ]; then /mnt/prince-data/JULIA/$JULIA_VER/bin/julia --color=yes -e 'cd(Pkg.dir("COBRA")); include(joinpath("docs", "makeDoc.jl"))'; fi
52+
after_script:
53+
# clean up the build directory
54+
- cd .. && rm -rf COBRA

.artenolis/runtests.sh

+8-26
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,21 @@ echo "MATLAB_VER = $MATLAB_VER"
55

66
# launch the test script
77
if [ "$ARCH" == "Linux" ]; then
8-
if [ "$JULIA_VER" == "v0.6.4" ]; then
9-
# remove th julia directory to clean the installation directory
10-
rm -rf ~/.julia/v0.6/COBRA
11-
12-
# add the COBRA module
13-
/mnt/prince-data/JULIA/$JULIA_VER/bin/julia --color=yes -e 'Pkg.clone(pwd()); cd(Pkg.dir("COBRA")); Pkg.test(pwd(), coverage=true);'
14-
15-
elif [ "$JULIA_VER" == "v0.7.0" ]; then
16-
# add the COBRA module
17-
/mnt/prince-data/JULIA/$JULIA_VER/bin/julia --color=yes -e 'using Pkg; Pkg.clone(pwd())'
18-
fi
8+
$ARTENOLIS_SOFT_PATH/julia/$JULIA_VER/bin/julia --color=yes -e 'import Pkg; Pkg.clone(pwd()); Pkg.test("COBRA", coverage=true); Pkg.rm("COBRA");'
199

2010
elif [ "$ARCH" == "macOS" ]; then
21-
# remove th julia directory to clean the installation directory
22-
rm -rf ~/.julia/v0.6/COBRA
23-
2411
caffeinate -u &
25-
/Applications/Julia-$JULIA_VER.app/Contents/Resources/julia/bin/julia --color=yes -e 'Pkg.clone(pwd()); cd(Pkg.dir("COBRA")); Pkg.test(pwd());'
12+
/Applications/Julia-$JULIA_VER.app/Contents/Resources/julia/bin/julia --color=yes -e 'import Pkg; Pkg.clone(pwd()); Pkg.test("COBRA"); Pkg.rm("COBRA");'
2613

2714
elif [ "$ARCH" == "windows" ]; then
28-
if [ "$JULIA_VER" == "v0.6.4" ]; then
29-
# remove th julia directory to clean the installation directory
30-
rm -rf ~/.julia/v0.6/COBRA
31-
32-
unset Path
33-
nohup "D:\\JULIA\\$JULIA_VER\\\bin\\julia.exe" --color=yes -e 'import Base; ENV["MATLAB_HOME"]="D:\\MATLAB\\$(ENV["MATLAB_VER"])"; Pkg.clone(pwd()); cd(Pkg.dir("COBRA")); Pkg.test(pwd());' > output.log & PID=$!
15+
unset Path
16+
nohup "$ARTENOLIS_SOFT_PATH\\julia\\$JULIA_VER\\\bin\\julia.exe" --color=yes -e 'import Pkg; Pkg.clone(pwd()); Pkg.test("COBRA"); Pkg.rm("COBRA");' > output.log & PID=$!
3417

35-
# follow the log file
36-
tail -n0 -F --pid=$! output.log 2>/dev/null
18+
# follow the log file
19+
tail -n0 -F --pid=$! output.log 2>/dev/null
3720

38-
# wait until the background process is done
39-
wait $PID
40-
fi
21+
# wait until the background process is done
22+
wait $PID
4123
fi
4224

4325
CODE=$?

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ docs/build/
1717
docs/tutorial/results.mat
1818
results/*
1919
test/testModels
20-
21-
docs/src/tutorials.md
20+
Manifest.toml
21+
docs/src/tutorials.md

.travis.yml

+1-18
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ os:
44
- linux
55

66
julia:
7-
- 0.6
8-
- 0.7
7+
- 1.0
98
- nightly
109

1110
matrix:
1211
allow_failures:
13-
- julia: 0.7
1412
- julia: nightly
1513

1614
notifications:
@@ -25,18 +23,3 @@ addons:
2523
- libgmp-dev
2624
- libglpk-dev
2725

28-
git:
29-
depth: 99999
30-
31-
before_install:
32-
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
33-
34-
script:
35-
# update all packages
36-
- julia --color=yes -e 'Pkg.update();'
37-
38-
# temporary addition for julia 0.6 until new version of MAT tagged
39-
- julia --color=yes -e 'Pkg.add("MAT"); Pkg.checkout("MAT")'
40-
41-
# add and test the COBRA module
42-
- julia --color=yes -e 'Pkg.clone(pwd()); Pkg.test("COBRA")'

Project.toml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name = "COBRA"
2+
uuid = "58298e0b-d05c-52ec-a210-0694647ebfc7"
3+
version = "0.3.0"
4+
5+
[deps]
6+
CPLEX = "a076750e-1247-5638-91d2-ce28b192dca0"
7+
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
8+
GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6"
9+
GLPKMathProgInterface = "3c7084bd-78ad-589a-b5bb-dbd673274bea"
10+
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
11+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
12+
MAT = "23992714-dd62-5051-b70f-ba57cb901cac"
13+
MathProgBase = "fdba3010-5040-5b88-9595-932c9decdf73"
14+
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
15+
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
16+
17+
[compat]
18+
HTTP = ">= 0.8.0"
19+
MAT = ">= 0.5.0"
20+
julia = "1"
21+
22+
[extras]
23+
CPLEX = "a076750e-1247-5638-91d2-ce28b192dca0"
24+
GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6"
25+
GLPKMathProgInterface = "3c7084bd-78ad-589a-b5bb-dbd673274bea"
26+
Gurobi = "2e9cd046-0924-5485-92f1-d5272153d98b"
27+
MAT = "23992714-dd62-5051-b70f-ba57cb901cac"
28+
MATLAB = "10e44e05-a98a-55b3-a45b-ba969058deb6"
29+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
30+
31+
[targets]
32+
test = ["GLPKMathProgInterface", "GLPK", "Test"]

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ Shall no solvers be detected on your system, error messages may be thrown when t
5050

5151
The code has been benchmarked against the `fastFVA` implementation [[3](#References-1)]. A test model `ecoli_core_model.mat` [[4](#References-1)] can be used to pre-compile the code and can be downloaded using
5252
```Julia
53-
julia> using Requests
54-
julia> include("$(Pkg.dir("COBRA"))/test/getTestModel.jl")
53+
julia> using HTTP, COBRA
54+
julia> pkgDir = joinpath(dirname(pathof(COBRA)), "..")
55+
julia> include(pkgDir*"/test/getTestModel.jl")
5556
julia> getTestModel()
5657
```
5758

REQUIRE

-4
This file was deleted.

config/sshCfg.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@
77

88
#-------------------------------------------------------------------------------------------
99

10-
sshWorkers = Array{Dict{Any, Any}}(3)
10+
sshWorkers = Array{Dict{Any, Any}}(undef, 3)
1111

12-
sshWorkers[1,:] = Dict( "usernode" => "first.last@server1.com",
12+
sshWorkers[1] = Dict( "usernode" => "first.last@server1.com",
1313
"procs" => 8,
1414
"dir" => `"~"/COBRA.jl/`,
1515
"flags" => `-6 -p8022`,
1616
"exename"=> "/usr/bin/julia/bin/./julia")
1717

18-
sshWorkers[2,:] = Dict( "usernode" => "first.last@server2.com",
18+
sshWorkers[2] = Dict( "usernode" => "first.last@server2.com",
1919
"procs" => 16,
2020
"dir" => `"~"/COBRA.jl/`,
2121
"flags" => "-p22",
2222
"exename"=> "/usr/bin/julia/bin/./julia")
2323

24-
sshWorkers[3,:] = Dict( "usernode" => "first.last@server3.com",
24+
sshWorkers[3] = Dict( "usernode" => "first.last@server3.com",
2525
"procs" => 32,
2626
"dir" => `"~"/COBRA.jl/`,
2727
"flags" => "-4 -p9997",

docs/makeDoc.jl docs/make.jl

+11-25
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,9 @@
77

88
#-------------------------------------------------------------------------------------------
99

10+
import Pkg
1011
using Documenter
11-
12-
if !isdefined(:includeCOBRA) includeCOBRA = true end
13-
14-
if includeCOBRA
15-
include("../src/COBRA.jl")
16-
include("../src/load.jl")
17-
include("../src/solve.jl")
18-
include("../src/distributedFBA.jl")
19-
include("../src/connect.jl")
20-
include("../src/checkSetup.jl")
21-
include("../src/tools.jl")
22-
23-
# only include PALM.jl if MATLAB is present
24-
if sizeof(Pkg.installed("MATLAB")) > 0
25-
include("../src/PALM.jl")
26-
end
27-
end
12+
using COBRA
2813

2914
# special concatenation of tutorials until issue 701 is fixed:
3015
# https://github.com/JuliaDocs/Documenter.jl/issues/701
@@ -34,20 +19,22 @@ end
3419
currentDir = pwd()
3520

3621
# concatenate tutorial files
37-
cd("$(Pkg.dir("COBRA"))/tutorials")
22+
pkgDir = joinpath(dirname(pathof(COBRA)))
23+
cd(pkgDir*"/../tutorials")
3824

3925
# define list of tutorials to be concatenated
4026
tutorials = ["tutorial-COBRA.jl.md", "tutorial-distributedFBA.jl.md", "tutorial-PALM.jl.md"]
4127

4228
# concatenate the tutorials properly speaking
4329
cat = ""
4430
for tut in tutorials
31+
global cat
4532
tmp = read(tut, String)
4633
cat = cat * tmp
4734
end
4835

4936
# set all headers one level lower
50-
cat = replace(cat, "\n#", "\n##")
37+
cat = replace(cat, "\n#" => "\n##")
5138

5239
# write out the tutorial to new file
5340
open("tutorials.md", "w") do f
@@ -56,12 +43,12 @@ open("tutorials.md", "w") do f
5643
end
5744

5845
# move the tutorials.md file to the docs folder
59-
mv("tutorials.md", "$(Pkg.dir("COBRA"))/docs/src/tutorials.md", remove_destination=true)
46+
mv("tutorials.md", pkgDir*"/../docs/src/tutorials.md", force=true)
6047

6148
# change back to the old directory
6249
cd(currentDir)
6350

64-
makedocs(format = :html,
51+
makedocs(format = Documenter.HTML(),
6552
sitename = "COBRA.jl",
6653
pages = Any[ # Compat: `Any` for 0.4 compat
6754
"index.md",
@@ -76,9 +63,8 @@ makedocs(format = :html,
7663
)
7764

7865
deploydocs(repo = "github.com/opencobra/COBRA.jl.git",
79-
julia = get(ENV, "JULIA_VER", ""),
8066
target = "build",
81-
make = nothing,
82-
deps = nothing,
83-
latest = get(ENV, "GIT_BRANCH", "")
67+
branch = "gh-pages",
68+
devbranch = "origin/develop",
69+
versions = ["stable" => "v^", "v#.#"]
8470
)

docs/src/beginnerGuide.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
What is Julia?
44
--------------
55

6-
"*Julia is a high-level, high-performance dynamic programming language []*". You may read more about Julia [here](http://julialang.org).
6+
"*Julia is a high-level, high-performance dynamic programming language []*".
7+
You may read more about Julia [here](http://julialang.org).
78

89
How do I get Julia?
910
-------------------
@@ -36,7 +37,7 @@ If you need help, you can always type a `?`at the Julia REPL. For instance, if y
3637
? abs
3738
```
3839

39-
You may also find the [FAQ section](faq.html) of this documentation interesting, especially if you are running into issues.
40+
You may also find the [FAQ](@ref) of this documentation interesting, especially if you are running into issues.
4041

4142
How do I install a solver?
4243
--------------------------
@@ -72,11 +73,6 @@ Pkg.add("GLPKMathProgInterface")
7273

7374
Other supported solvers, such as `CPLEX`, `Clp`, `Gurobi`, or `Mosek`, may be installed in a similar way. Their respective interfaces are described [here](https://github.com/JuliaOpt). If you want to use `CPLEX`, you must follow the installation instructions [here](https://github.com/JuliaOpt/CPLEX.jl). Most importantly, make sure that you set the `LD_LIBRARY_PATH` environment variable.
7475

75-
Now I have a solver, and I have Julia. What is next?
76-
------------------------------------------------------
77-
78-
You are now all set to install `COBRA.jl`. Follow the installation instructions [here](index.html). You may then also follow this [tutorial](cobratutorial.html) to get you started.
79-
8076
There is a tutorial, but I cannot open it. What should I do?
8177
------------------------------------------------------------
8278

docs/src/configuration.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
In order to load currently defined solver parameters, the following file may be included in the script, which defines the `solParams` array:
66
```julia
7-
include("$(Pkg.dir("COBRA"))/config/solverCfg.jl")
7+
pkgDir = joinpath(dirname(pathof(COBRA)), "..")
8+
include(pkgDir*"/config/solverCfg.jl")
89
```
910
Then, the `COBRA` solver can be set with:
1011
```julia
@@ -49,7 +50,8 @@ solParams = [
4950

5051
A parallel pool with workers on SSH nodes can be created using:
5152
```julia
52-
include("$(Pkg.dir("COBRA"))/src/connect.jl")
53+
pkgDir = joinpath(dirname(pathof(COBRA)), "..")
54+
include(pkgDir*"/src/connect.jl")
5355
workersPool, nWorkers = createPool(12, true, "mySSHCfg.jl")
5456
```
5557
which will connect 12 local workers, and all workers defined in `mySSHCfg.jl`. An example connection file is provided in the `config/` folder of the `COBRA` package installation folder.

docs/src/faq.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Frequently Asked Questions (FAQ)
1+
# [Frequently Asked Questions (FAQ)](@id FAQ)
22

33
Why can't I build packages in Julia?
44
------------------------------------
@@ -64,4 +64,4 @@ How can I get the latest version of `COBRA.jl`
6464
If you want to enjoy the latest untagged (but eventually unstable) features of `COBRA.jl`, do the following from within `Julia`:
6565
```Julia
6666
julia> Pkg.checkout("COBRA", "develop")
67-
```
67+
```

0 commit comments

Comments
 (0)