Documentation | Example usage | Installation | How to cite?
See examples/simple_example.ipynb for a self-contained Jupyter notebook that illustrates forward and inverse modelling.
DiaBayes comes with a web-based GUI that exposes a number of basic features, like data visualisation, forward modelling, and inversion, using the more conventional friction models. This GUI persistently stores its environment state so that you can resume the analysis over consecutive sessions. You can also export and share this environment state, for example as a supplementary material to a publication.
To enable the GUI, make sure to install it first (see the next section). Then, to initialise a workspace, execute:
cd /path/to/workspace
diabayes init . # Initialise the environment (run only once per environment)
diabayes run # Start the GUI serverPoint your browser at the URL printed after the run command (default: http://127.0.0.1:5000).
The init command will produce a default workspace.toml file with settings that can be adjusted by the user (requires relaunching the server to take effect).
If you use conda, create or switch to the desired environment:
conda create -n diabayes python=3.14 pip
conda activate diabayesInstall the latest version with CPU support from GitHub:
pip install git@github.com:martijnende/diabayes.git # Base version
pip install "diabayes[gpu,gui] @ git+github.com:martijnende/diabayes.git" # Base version + GPU support + GUIYou can also install from a local directory after cloning the repository
git clone git@github.com:martijnende/diabayes.git && cd diabayes
pip install . # Base version
pip install .[gpu,gui] # Base version + GPU support + GUIIf you plan to contribute to the development of this package, please include the development tools:
pip install .[dev]Using Astral UV, you create a dedicated environment with:
git clone git@github.com:martijnende/diabayes.git && cd diabayes
uv sync # Install just the base environment
uv sync --extra gui --extra gpu # Equivalent to pip install .[gui,gpu]
uv sync --extra-all # Install everythingWhen working from a different workspace directory, you can instruct UV to use a specific virtual environment by setting an environment variable:
export VIRTUAL_ENV="/path/to/diabayes/.venv/" # For bash, zsh, ...
set -gx VIRTUAL_ENV "/path/to/diabayes/.venv/" # For fishYou can then run the DiaBayes GUI from a different workspace directory as:
cd /path/to/workspace
uv run diabayes init .
uv run diabayes runCurrently DiaBayes only supports Nvidia GPUs with Cuda version 12, simply because that is what I have on my local machine.
Feel free to change the gpu option in pyproject.toml to change the JAX version that is supported by your hardware.
See the JAX installation guide for detailed instructions.
Note that the GPU is only used for Bayesian inference (SVI); all other components of the software use the CPU.
A publication describing this software package is underway. Until then, feel free to refer to this repository.