Installing MALA

Prerequisites

MALA does not depend on a specific Python version. The most recent Python version it has been tested with successfully is Python 3.10.4.

MALA requires torch in order to function. As the installation of torch depends highly on the architecture you are using, torch will not automatically be installed alongside MALA. Please obtain a suitable version of torch from the official website before continuing.

Installing the Python library

  • Download the MALA repository, e.g., with git clone git@github.com:mala-project/mala.git

  • Change into the directory you cloned the repository to

  • Install MALA via pip install -e .[options]

The following options are available:

  • dev: Installs bump2version which is needed to correctly increment the version and thus needed for large code development (developers)

  • opt: Installs oapackage, so that the orthogonal array method may be used for large scale hyperparameter optimization (advanced users)

  • test: Installs pytest which allows users to test the code (developers)

  • doc: Installs all dependencies for building the documentary locally (developers)

Build documentation locally (Optional)

  • Install the prerequisites (if you haven’t already during the MALA setup) via pip install -r docs/requirements.txt

  • Change into docs/ folder.

  • Run make apidocs on Linux/macOS or .\make.bat apidocs on Windows.

  • Run make html on Linux/macOS or .\make.bat html on Windows. This creates a _build folder inside docs. You may also want to use make html SPHINXOPTS="-W" sometimes. This treats warnings as errors and stops the output at first occurence of an error (useful for debugging rST syntax).

  • Open docs/_build/html/index.html.

  • Run make clean on Linux/macOS or .\make.bat clean on Windows. if required (e.g. after fixing erros) and building again