Skip to content

Latest commit

 

History

History
81 lines (54 loc) · 2.52 KB

CONTRIBUTING.md

File metadata and controls

81 lines (54 loc) · 2.52 KB

Contributing to novae

Contributions are welcome as we aim to continue improving novae. For instance, you can contribute by:

  • Opening an issue
  • Discussing the current state of the code
  • Making a Pull Request (PR)

If you want to open a PR, follow the following instructions.

Making a Pull Request (PR)

To add some new code to novae, you should:

  1. Fork the repository
  2. Install novae in editable mode with the dev extra (see below)
  3. Create your personal branch from main
  4. Implement your changes according to the 'Coding guidelines' below
  5. Create a pull request on the main branch of the original repository. Add explanations about your developed features, and wait for discussion and validation of your pull request

Installing novae in editable mode

When contributing, installing novae in editable mode is recommended. We also recommend installing the dev extra.

For that, choose between pip and poetry as below:

git clone https://github.com/MICS-Lab/novae.git
cd novae

pip install -e '.[dev]' # pip installation
poetry install -E dev   # poetry installation

Coding guidelines

Styling and formatting

We use pre-commit to run code quality controls before the commits. This includes running black, isort, flake8, and others.

You can set it up at the root of the repository like this:

pre-commit install

Then, it will run the pre-commit automatically before each commit.

You can also run the pre-commit manually:

pre-commit run --all-files

Apart from this, we recommend to follow the standard styling conventions:

  • Follow the PEP8 style guide.
  • Provide meaningful names to all your variables and functions.
  • Provide type hints to your function inputs/outputs.
  • Add docstrings in the Google style.
  • Try as much as possible to follow the same coding style as the rest of the repository.

Testing

When create a pull request, tests are run automatically. But you can also run the tests yourself before making the PR. For that, run pytest at the root of the repository. You can also add new tests in the ./tests directory.

To check the coverage of the tests:

coverage run -m pytest
coverage report # command line report
coverage html # html report

Documentation

You can update the documentation in the ./docs directory. Refer to the mkdocs-material documentation for more help.

To serve the documentation locally:

mkdocs serve