Skip to content

Installation#

Using Docker#

If you want to avoid Python environments, you can use a Docker image to run GeNet. To build the image:

git clone git@github.com:arup-group/genet.git
cd genet
docker build -t "cml-genet" .

Instructions for running GeNet from within the Docker image can be found here.

Setting up a user environment#

As a genet user, it is easiest to install using the mamba package manager, as follows:

  1. Install mamba with the Mambaforge executable for your operating system.
  2. Open the command line (or the "miniforge prompt" in Windows).
  3. Download (a.k.a., clone) the genet repository: git clone git@github.com:{{ cookiecutter.repository_owner }}/genet.git
  4. Change into the genet directory: cd genet
  5. Create the genet mamba environment: mamba create -n genet -c conda-forge -c city-modelling-lab --file requirements/base.txt
  6. Activate the genet mamba environment: mamba activate genet
  7. Install the cml-genet package into the environment, ignoring dependencies (we have dealt with those when creating the mamba environment): pip install --no-deps .

All together:

git clone git@github.com:arup-group/genet.git
cd genet
mamba create -n genet -c conda-forge --file requirements/base.txt
mamba activate genet
pip install --no-deps .

Running the example notebooks#

If you have followed the non-developer installation instructions above, you will need to install jupyter into your genet environment to run the example notebooks:

mamba install -n genet jupyter

With Jupyter installed, it's easiest to then add the environment as a jupyter kernel:

mamba activate genet
ipython kernel install --user --name=genet
jupyter notebook

Choosing a different environment name#

If you would like to use a different name to genet for your mamba environment, the installation becomes (where [my-env-name] is your preferred name for the environment):

mamba create -n [my-env-name] -c conda-forge --file requirements/base.txt
mamba activate [my-env-name]
ipython kernel install --user --name=[my-env-name]

Setting up a development environment#

The install instructions are slightly different to create a development environment compared to a user environment:

git clone git@github.com:arup-group/genet.git
cd genet
mamba create -n genet -c conda-forge --file requirements/base.txt --file requirements/dev.txt
mamba activate genet
pip install --no-deps -e .
ipython kernel install --user --name=genet

For more detailed installation instructions specific to developing the genet codebase, see our development documentation.

A note on the mathematical solver#

Note

The default CBC solver is pre-installed inside GeNet's Docker image, which can save you some installation effort.

To use methods which snap public transit to the graph, GeNet uses a mathematical solver. If you won't be using such functionality, you do not need to install this solver. Methods default to CBC, an open source solver. On Non-Windows devices, you can install this solver (coin-or-cbc) along with your other requirements when creating the environment: mamba create -n genet -c conda-forge -c city-modelling-lab coin-or-cbc --file requirements/base.txt, or install it after the fact mamba install -n genet coin-or-cbc

Any solver supported by Pyomo can be used. Another good open source choice is GLPK. The solver you use needs to support MILP - mixed integer linear programming.