Skip to content

Commit

Permalink
Update documentation for PR#104 (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
KeShih authored Aug 29, 2024
1 parent c0b5eae commit e89128c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ poetry shell
poetry install
```

To exploit the fast implementations of dingo, you have to install the [Gurobi solver](https://www.gurobi.com/). Run
You can install the [Gurobi solver](https://www.gurobi.com/) for faster linear programming optimization. Run

```
pip3 install -i https://pypi.gurobi.com gurobipy
Expand All @@ -75,7 +75,7 @@ Then, you will need a [license](https://www.gurobi.com/downloads/end-user-licens

## Unit tests

Now, you can run the unit tests by the following commands:
Now, you can run the unit tests by the following commands (with the default solver `highs`):
```
python3 tests/fba.py
python3 tests/full_dimensional.py
Expand All @@ -87,7 +87,12 @@ python3 tests/sampling.py

If you have installed Gurobi successfully, then run
```
python3 tests/fast_implementation_test.py
python3 tests/fba.py gurobi
python3 tests/full_dimensional.py gurobi
python3 tests/max_ball.py gurobi
python3 tests/scaling.py gurobi
python3 tests/rounding.py gurobi
python3 tests/sampling.py gurobi
```

## Tutorial
Expand Down Expand Up @@ -184,21 +189,16 @@ The MCMC methods that dingo (through `volesti` library) provides are the followi



#### Switch the linear programming solver


#### Fast and slow mode

If you have installed successfully the `gurobi` library, dingo turns to the *fast mode* by default. To set a certain mode you could use the following member functions,
We use `pyoptinterface` to interface with the linear programming solvers. To switch the solver that `dingo` uses, you can use the `set_default_solver` function. The default solver is `highs` and you can switch to `gurobi` by running,

```python
sampler = polytope_sampler(model)

#set fast mode to use gurobi library
sampler.set_fast_mode()
#set slow mode to use scipy functions
sampler.set_slow_mode()
from dingo import set_default_solver
set_default_solver("gurobi")
```

You can also switch to other solvers that `pyoptinterface` supports, but we recommend using `highs` or `gurobi`. If you have issues with the solver, you can check the `pyoptinterface` [documentation](https://metab0t.github.io/PyOptInterface/getting_started.html).

### Apply FBA and FVA methods

Expand Down
5 changes: 3 additions & 2 deletions tutorials/dingo_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,8 @@
"%pip install sparseqr &> /dev/null\n",
"%pip install Cython &> /dev/null\n",
"%pip install cobra &> /dev/null\n",
"%pip install kaleido &> /dev/null"
"%pip install kaleido &> /dev/null\n",
"%pip install pyoptinterface[highs] &> /dev/null"
]
},
{
Expand Down Expand Up @@ -611,7 +612,7 @@
"id": "rWJ00dGySfol"
},
"source": [
"If you look at the output of that command, you should see that every test passed, with the possible exception of `fast_implementation_test` if you haven't installed Gurobi.\n"
"If you look at the output of that command, you should see that every test passed.\n"
]
},
{
Expand Down

0 comments on commit e89128c

Please sign in to comment.