Skip to content

Contributing to Lmo

Any contributions to Lmo are appreciated!

Issues

Questions, feature requests and bug reports are all welcome as issues.

When reporting a bug, make sure to include the versions of lmo, python, numpy and scipy you are using, and provide a reproducible example of the bug.

Environment setup

Ensure you have poetry installed. It can help to use Lmo’s lowest-supported Python version, so that you don’t accidentally use those bleeding-edge Python features that you shouldn’t, e.g.

poetry env use python3.10

Now you can install the dev dependencies using

poetry install --sync

pre-commit

Lmo uses pre-commit to ensure that the code is formatted and typed correctly when committing the changes.

poetry run pre-commit install

It can also be manually run:

poetry run pre-commit --all-files

Testing

Lmo uses pytest and hypothesis as testing framework.

The tests can be run using

poetry run pytest

Documentation

If your change involves documentation updates, you can conjure up a live preview:

poetry run mkdocs serve

This will require pandoc and pandoc-citeproc to be installed on your system (e.g. using the conda-forge pypandoc package, on apt-get install pandoc pandoc-citeproc on Ubuntu).

This will make the site available at http://127.0.0.1:8000/. It automatically reloads when changes are made to the source code or the documentation.

But don’t worry about building the docs, or bumping the version; Lmo’s personal assistant will do that on release.