You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* chore: make example in README solver agnostic
And add a note on how to use a specific solver
* docs: add comments to README code
* Update requirements.txt
* docs: update README to reflect swiglpk as a dep.
swiglpk is a hard dependency now, so that 'pip install optlang' works out of the box.
* docs: update install instructions
Swiglpk is now a hard dependency so the installation instructions are updated accordingly.
* docs: update dependency versions in readme
* docs: update contributing guidelines
And add CONTRIBUTIONS.md file
* docs: update readme, paper and documentation
Add target audience to paper and docs/index
Add solver problem capabilities to readme
Move installation issue from readme to docs/installation
* test: remove libglp from travis.yml
* docs: highlight 'modeling language'
* docs: change paper title
* Some minor writing fixes (#57)
I made some minor writing fixes, to be adopted before acceptance in JOSS (openjournals/joss-reviews#139)
Copy file name to clipboardexpand all lines: README.rst
+33-37
Original file line number
Diff line number
Diff line change
@@ -10,13 +10,16 @@ problems, i.e. maximizing or minimizing an objective function over a set
10
10
of variables subject to a number of constraints. Optlang provides a
11
11
common interface to a series of optimization tools, so different solver
12
12
backends can be changed in a transparent way.
13
-
Optlang takes advantage of the symbolic math library
13
+
Optlang's object-oriented API takes advantage of the symbolic math library
14
14
`sympy <http://sympy.org/en/index.html>`__ to allow objective functions
15
15
and constraints to be easily formulated from symbolic expressions of
16
16
variables (see examples).
17
17
18
18
Show us some love by staring this repo if you find optlang useful!
19
19
20
+
Also, please use the GitHub `issue tracker <https://github.com/biosustain/optlang/issues>`_
21
+
to let us know about bugs or feature requests, or if you have problems or questions regarding optlang.
22
+
20
23
Installation
21
24
~~~~~~~~~~~~
22
25
@@ -26,35 +29,51 @@ Install using pip
26
29
27
30
pip install optlang
28
31
29
-
Then you could install `swiglpk <https://github.com/biosustain/swiglpk>`_
32
+
This will also install `swiglpk <https://github.com/biosustain/swiglpk>`_, an interface to the open source (mixed integer) LP solver `GLPK <https://www.gnu.org/software/glpk/>`_.
33
+
Quadratic programming (and MIQP) is supported through additional optional solvers (see below).
Copy file name to clipboardexpand all lines: docs/source/index.rst
+8-1
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,13 @@
1
1
optlang
2
2
*******
3
3
4
-
Optlang is a Python package for solving mathematical optimization problems, i.e. maximizing or minimizing an objective function over a set of variables subject to a number of constraints.
4
+
Optlang is a Python package implementing a modeling language for solving mathematical optimization problems, i.e. maximizing or minimizing an objective function over a set of variables subject to a number of constraints.
5
5
Optlang provides a common interface to a series of optimization tools, so different solver backends can be changed in a transparent way.
6
6
7
7
In constrast to e.g. the commonly used General Algebraic Modeling System (GAMS), optlang has a simple and intuitive interface using native Python algebra syntax, and is free and open-source.
8
8
9
9
Optlang takes advantage of the symbolic math library `SymPy <http://sympy.org>`_ to allow objective functions and constraints to be easily formulated from symbolic expressions of variables (see examples).
10
+
Scientists can thus use optlang to formulate their optimization problems using mathematical expressions derived from domain knowledge.
10
11
11
12
Currently supported solvers are:
12
13
@@ -79,6 +80,12 @@ You should see the following output::
79
80
x3 = 0.0
80
81
x1 = 33.3333333333
81
82
83
+
84
+
Using a particular solver
85
+
----------
86
+
If you have more than one solver installed, it's also possible to specify which one to use, by importing directly from the
Copy file name to clipboardexpand all lines: docs/source/installation.rst
+28-6
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ Install optlang using pip::
5
5
6
6
pip install optlang
7
7
8
-
Or, or download the source distribution and run::
8
+
Or download the source distribution and run::
9
9
10
10
python setup.py install
11
11
@@ -16,15 +16,17 @@ You can run optlang's test suite like this (you need to install nose first thoug
16
16
17
17
Solvers
18
18
----------
19
-
In addition to optlang itself, it is necessary to install at least one solver. Optlang interfaces with the solvers
20
-
through importable python modules. If the python module corresponding to the solver can be imported without errors
21
-
the solver interface should be available as an optlang submodule (e.g. :code:`optlang.glpk_interface`).
19
+
To solve optimization problems, at least one supported solver must be installed.
20
+
Installing optlang using :code:`pip` will also automatically install GLPK. To use other solvers (e.g. commercial solvers) it is necessary
21
+
to install them manually. Optlang interfaces with all solvers through importable python modules. If the python module corresponding
22
+
to the solver can be imported without errors the solver interface should be available as an optlang submodule (e.g.
23
+
:code:`optlang.glpk_interface`).
22
24
23
25
The required python modules for the currently supported solvers are:
24
26
25
-
- GLPK: :code:`swiglpk`
27
+
- GLPK: :code:`swiglpk` (automatically installed by :code:`pip install optlang`)
26
28
27
-
- GLPK is an open source Linear Programming library. Swiglpk can be installed from binary wheels or from source. Installing from source requires swig and GLPK
29
+
- GLPK is an open source Linear Programming library. Swiglpk can be installed from binary wheels or from source. Installing from source requires swig and GLPK.
28
30
29
31
- Cplex: :code:`cplex`
30
32
@@ -39,3 +41,23 @@ The required python modules for the currently supported solvers are:
39
41
- The SciPy linprog function is a very basic implementation of the simplex algorithm for solving linear optimization problems. Linprog is included in all recent versions of SciPy.
40
42
41
43
After importing optlang you can check :code:`optlang.available_solvers` to verify that a solver is recognized.
44
+
45
+
46
+
Issues
47
+
------
48
+
49
+
Local installations like
50
+
51
+
::
52
+
53
+
python setup.py install
54
+
55
+
56
+
might fail installing the dependencies (unresolved issue with
0 commit comments