Skip to content

Commit

Permalink
Merge pull request #56 from opencobra/develop
Browse files Browse the repository at this point in the history
Regular merge of develop
  • Loading branch information
laurentheirendt authored Sep 27, 2019
2 parents b043686 + caacf06 commit e8c41f4
Show file tree
Hide file tree
Showing 41 changed files with 576 additions and 476 deletions.
35 changes: 21 additions & 14 deletions .artenolis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,45 @@ script:

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

# clone the COBRA Toolbox
- rm -rf /tmp/cobratoolbox-cobrajl
- git clone https://github.com/opencobra/cobratoolbox.git /tmp/cobratoolbox-cobrajl --depth=1
- cd /tmp/cobratoolbox-cobrajl
- git submodule update --init --remote --no-fetch --depth=1

# change to the current directory
- cd $CURRENT_DIR

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

# change the test dependencies on Linux and macOS (ARTENOLIS)
- if [ "$ARCH" == "Linux" ] || [ "$ARCH" == "macOS" ]; then
CURRENT_DIR=`pwd`;
cd ~/tmp/cobratoolbox-cobrajl;
git pull origin master;
cd $CURRENT_DIR;
perl -i -pe's/test = \["GLPKMathProgInterface", "GLPK", "Test"\]/test = \["GLPKMathProgInterface", "GLPK", "Test", "MAT", "MATLAB", "Gurobi", "CPLEX"\]/g' Project.toml;
fi

# launch the tests
- bash .artenolis/runtests.sh

# clean up the build directory
- cd .. && rm -rf COBRA

after_success:
- 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

# submit coverage report
- if [[ "$ARCH" == "Linux" && "$JULIA_VER" == "v1.2.0" ]]; then
$ARTENOLIS_SOFT_PATH/julia/$JULIA_VER/bin/julia --color=yes -e 'import Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())';
fi

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

# deploy documentation
- 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
after_script:
# clean up the build directory
- cd .. && rm -rf COBRA
34 changes: 8 additions & 26 deletions .artenolis/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,21 @@ echo "MATLAB_VER = $MATLAB_VER"

# launch the test script
if [ "$ARCH" == "Linux" ]; then
if [ "$JULIA_VER" == "v0.6.4" ]; then
# remove th julia directory to clean the installation directory
rm -rf ~/.julia/v0.6/COBRA

# add the COBRA module
/mnt/prince-data/JULIA/$JULIA_VER/bin/julia --color=yes -e 'Pkg.clone(pwd()); cd(Pkg.dir("COBRA")); Pkg.test(pwd(), coverage=true);'

elif [ "$JULIA_VER" == "v0.7.0" ]; then
# add the COBRA module
/mnt/prince-data/JULIA/$JULIA_VER/bin/julia --color=yes -e 'using Pkg; Pkg.clone(pwd())'
fi
$ARTENOLIS_SOFT_PATH/julia/$JULIA_VER/bin/julia --color=yes -e 'import Pkg; Pkg.clone(pwd()); Pkg.test("COBRA", coverage=true); Pkg.rm("COBRA");'

elif [ "$ARCH" == "macOS" ]; then
# remove th julia directory to clean the installation directory
rm -rf ~/.julia/v0.6/COBRA

caffeinate -u &
/Applications/Julia-$JULIA_VER.app/Contents/Resources/julia/bin/julia --color=yes -e 'Pkg.clone(pwd()); cd(Pkg.dir("COBRA")); Pkg.test(pwd());'
/Applications/Julia-$JULIA_VER.app/Contents/Resources/julia/bin/julia --color=yes -e 'import Pkg; Pkg.clone(pwd()); Pkg.test("COBRA"); Pkg.rm("COBRA");'

elif [ "$ARCH" == "windows" ]; then
if [ "$JULIA_VER" == "v0.6.4" ]; then
# remove th julia directory to clean the installation directory
rm -rf ~/.julia/v0.6/COBRA

unset Path
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=$!
unset Path
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=$!

# follow the log file
tail -n0 -F --pid=$! output.log 2>/dev/null
# follow the log file
tail -n0 -F --pid=$! output.log 2>/dev/null

# wait until the background process is done
wait $PID
fi
# wait until the background process is done
wait $PID
fi

CODE=$?
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ docs/build/
docs/tutorial/results.mat
results/*
test/testModels

docs/src/tutorials.md
Manifest.toml
docs/src/tutorials.md
19 changes: 1 addition & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ os:
- linux

julia:
- 0.6
- 0.7
- 1.0
- nightly

matrix:
allow_failures:
- julia: 0.7
- julia: nightly

notifications:
Expand All @@ -25,18 +23,3 @@ addons:
- libgmp-dev
- libglpk-dev

git:
depth: 99999

before_install:
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi

script:
# update all packages
- julia --color=yes -e 'Pkg.update();'

# temporary addition for julia 0.6 until new version of MAT tagged
- julia --color=yes -e 'Pkg.add("MAT"); Pkg.checkout("MAT")'

# add and test the COBRA module
- julia --color=yes -e 'Pkg.clone(pwd()); Pkg.test("COBRA")'
32 changes: 32 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name = "COBRA"
uuid = "58298e0b-d05c-52ec-a210-0694647ebfc7"
version = "0.3.0"

[deps]
CPLEX = "a076750e-1247-5638-91d2-ce28b192dca0"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6"
GLPKMathProgInterface = "3c7084bd-78ad-589a-b5bb-dbd673274bea"
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MAT = "23992714-dd62-5051-b70f-ba57cb901cac"
MathProgBase = "fdba3010-5040-5b88-9595-932c9decdf73"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[compat]
HTTP = ">= 0.8.0"
MAT = ">= 0.5.0"
julia = "1"

[extras]
CPLEX = "a076750e-1247-5638-91d2-ce28b192dca0"
GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6"
GLPKMathProgInterface = "3c7084bd-78ad-589a-b5bb-dbd673274bea"
Gurobi = "2e9cd046-0924-5485-92f1-d5272153d98b"
MAT = "23992714-dd62-5051-b70f-ba57cb901cac"
MATLAB = "10e44e05-a98a-55b3-a45b-ba969058deb6"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["GLPKMathProgInterface", "GLPK", "Test"]
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ Shall no solvers be detected on your system, error messages may be thrown when t

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
```Julia
julia> using Requests
julia> include("$(Pkg.dir("COBRA"))/test/getTestModel.jl")
julia> using HTTP, COBRA
julia> pkgDir = joinpath(dirname(pathof(COBRA)), "..")
julia> include(pkgDir*"/test/getTestModel.jl")
julia> getTestModel()
```

Expand Down
4 changes: 0 additions & 4 deletions REQUIRE

This file was deleted.

8 changes: 4 additions & 4 deletions config/sshCfg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@

#-------------------------------------------------------------------------------------------

sshWorkers = Array{Dict{Any, Any}}(3)
sshWorkers = Array{Dict{Any, Any}}(undef, 3)

sshWorkers[1,:] = Dict( "usernode" => "[email protected]",
sshWorkers[1] = Dict( "usernode" => "[email protected]",
"procs" => 8,
"dir" => `"~"/COBRA.jl/`,
"flags" => `-6 -p8022`,
"exename"=> "/usr/bin/julia/bin/./julia")

sshWorkers[2,:] = Dict( "usernode" => "[email protected]",
sshWorkers[2] = Dict( "usernode" => "[email protected]",
"procs" => 16,
"dir" => `"~"/COBRA.jl/`,
"flags" => "-p22",
"exename"=> "/usr/bin/julia/bin/./julia")

sshWorkers[3,:] = Dict( "usernode" => "[email protected]",
sshWorkers[3] = Dict( "usernode" => "[email protected]",
"procs" => 32,
"dir" => `"~"/COBRA.jl/`,
"flags" => "-4 -p9997",
Expand Down
36 changes: 11 additions & 25 deletions docs/makeDoc.jl → docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,9 @@

#-------------------------------------------------------------------------------------------

import Pkg
using Documenter

if !isdefined(:includeCOBRA) includeCOBRA = true end

if includeCOBRA
include("../src/COBRA.jl")
include("../src/load.jl")
include("../src/solve.jl")
include("../src/distributedFBA.jl")
include("../src/connect.jl")
include("../src/checkSetup.jl")
include("../src/tools.jl")

# only include PALM.jl if MATLAB is present
if sizeof(Pkg.installed("MATLAB")) > 0
include("../src/PALM.jl")
end
end
using COBRA

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

# concatenate tutorial files
cd("$(Pkg.dir("COBRA"))/tutorials")
pkgDir = joinpath(dirname(pathof(COBRA)))
cd(pkgDir*"/../tutorials")

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

# concatenate the tutorials properly speaking
cat = ""
for tut in tutorials
global cat
tmp = read(tut, String)
cat = cat * tmp
end

# set all headers one level lower
cat = replace(cat, "\n#", "\n##")
cat = replace(cat, "\n#" => "\n##")

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

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

# change back to the old directory
cd(currentDir)

makedocs(format = :html,
makedocs(format = Documenter.HTML(),
sitename = "COBRA.jl",
pages = Any[ # Compat: `Any` for 0.4 compat
"index.md",
Expand All @@ -76,9 +63,8 @@ makedocs(format = :html,
)

deploydocs(repo = "github.com/opencobra/COBRA.jl.git",
julia = get(ENV, "JULIA_VER", ""),
target = "build",
make = nothing,
deps = nothing,
latest = get(ENV, "GIT_BRANCH", "")
branch = "gh-pages",
devbranch = "origin/develop",
versions = ["stable" => "v^", "v#.#"]
)
10 changes: 3 additions & 7 deletions docs/src/beginnerGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
What is Julia?
--------------

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

How do I get Julia?
-------------------
Expand Down Expand Up @@ -36,7 +37,7 @@ If you need help, you can always type a `?`at the Julia REPL. For instance, if y
? abs
```

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

How do I install a solver?
--------------------------
Expand Down Expand Up @@ -72,11 +73,6 @@ Pkg.add("GLPKMathProgInterface")

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.

Now I have a solver, and I have Julia. What is next?
------------------------------------------------------

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.

There is a tutorial, but I cannot open it. What should I do?
------------------------------------------------------------

Expand Down
6 changes: 4 additions & 2 deletions docs/src/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

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

A parallel pool with workers on SSH nodes can be created using:
```julia
include("$(Pkg.dir("COBRA"))/src/connect.jl")
pkgDir = joinpath(dirname(pathof(COBRA)), "..")
include(pkgDir*"/src/connect.jl")
workersPool, nWorkers = createPool(12, true, "mySSHCfg.jl")
```
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.
Expand Down
4 changes: 2 additions & 2 deletions docs/src/faq.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Frequently Asked Questions (FAQ)
# [Frequently Asked Questions (FAQ)](@id FAQ)

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

0 comments on commit e8c41f4

Please sign in to comment.