Installation#
Using Docker#
If you want to avoid Python environments, you can use a Docker image to run GeNet. To build the image:
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:
- Install mamba with the Mambaforge executable for your operating system.
- Open the command line (or the "miniforge prompt" in Windows).
- Download (a.k.a., clone) the genet repository:
git clone git@github.com:{{ cookiecutter.repository_owner }}/genet.git
- Change into the
genet
directory:cd genet
- Create the genet mamba environment:
mamba create -n genet -c conda-forge -c city-modelling-lab --file requirements/base.txt
- Activate the genet mamba environment:
mamba activate genet
- 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 -c city-modelling-lab --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:
With Jupyter installed, it's easiest to then add the environment as a jupyter kernel:
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 -c city-modelling-lab --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 -c city-modelling-lab --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.