Skip to content

Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. build Ruff Code style: black

Personalised Mutual Hazard Networks

Principled probabilistic modelling with Mutual Hazard Networks.

Running the workflows

To facilitate reproducibility we use Snakemake. We recommend creating a new virtual environment (e.g., using Micromamba) and installing Snakemake as described in their documentation.

Once the environment is set, the package can be installed using

$ pip install -e .  # Note -e which will allow modifying the code when needed

Contributing

We use Poetry to control dependencies.

When Poetry is installed, clone the repository and type

$ poetry install --with dev

to install the package with the dependencies used for development.

At this stage you should be able to use Pytest to run unit tests:

$ poetry run pytest

Alternatively, you may want to work inside Poetry environment:

$ poetry shell
$ pytest

When you submit a pull request, automated continuous integration tests will be run. They include unit tests as well as code quality checks. To run the code quality checks automatically at each commit made, we use pre-commit. To activate it run:

$ poetry shell  # If it is not already active
$ pre-commit install

Acknowledgements

This package is built around LearnMHN (the backend for Mutual Hazard Networks) and PyMC (probabilistic programming framework).