Contributor Guide

Thanks for your interest in contributing to blobmodel! Any contributions such as bug reports, feature requests or even pull requests are very welcome!

Install development version

If you want to contribute code to blobmodel, we recommend first forking the GitHub repository. Next, install the package in development mode:

# replace your_account with appropriate name
git clone https://github.com/your_account/blobmodel.git
cd blobmodel
pip install -e .

The -e specifies that this will be an editable installation.

Tip

It is advisable to use a virtual environment for code development. Popular options are Virtualenv and Conda.

Code Contribution Workflow

After the package is installed, we can startthe cycle of making changes:

  1. Edit or create the files and save the changes.

  2. In a terminal, run:

git add filename

Replace filename with the name of the edited file(s).

  1. Commit the changes:

git commit -m "commit message"

Replace commit message with a description of the committed changes.

  1. Push the changes to GitHub:

git push
  1. If you now go back to your GitHub repository of blobmodel, a pale yellow box will appear near the top of the screen, there click on Compare & pull request.

  2. Add a descriptive title and a description of the pull request, then select Create pull request.

Formatting Guide

blobmodel uses Black for code formatting. Make sure to run

black edited/new file

on all edited and added python files in your pull request. For documentation we recomend following the numpy style guide.

Testing Guide

Any new code contributed to blobmodel requires testing before it can be merged. All tests are located in the subdirectory tests/. After you added your tests to this directory you can run

pytest

to check whether all tests pass.

In order to check whether all your new code is covered by tests, run:

pytest --cov
coverage html

You can now open htmlcov/index.html with your browser to check whether all of your lines are covered by tests.

As a last point, we recommend adding type hints to your new functions and classes, which ensures that you’re using variables and functions in your code correctly. We use mypy for this purpose. Check your code by running:

mypy  --ignore-missing-imports .