Contribute to YASA#

There are many ways to contribute to YASA: reporting bugs, adding new functions, improving the documentation, etc…

Code guidelines#

Before starting new code, we highly recommend opening an issue on GitHub to discuss potential changes.

  • Please use standard pep8 and flake8 Python style guidelines. YASA uses ruff for linting and code formatting, enforced via a pre-commit hook. To install it:

$ pip install pre-commit
$ pre-commit install

Once installed, the hook will automatically run ruff (linting with auto-fix) and ruff-format on every commit. You can also run it manually at any time with:

$ pre-commit run --all-files
  • Use NumPy style for docstrings. Follow existing examples for simplest guidance.

  • When adding new functions, make sure that they are generalizable to various situations.

  • Changes must be accompanied by updated documentation and examples.

  • After making changes, ensure all tests pass. This can be done by running:

$ pytest

Checking and building documentation#

YASA’s documentation (including docstring in code) uses ReStructuredText format, see Sphinx documentation to learn more about editing them. The code follows the NumPy docstring standard.

All changes to the codebase must be properly documented. To ensure that documentation is rendered correctly, the best bet is to follow the existing examples for function docstrings. If you want to test the documentation locally, you will need to install the required packages:

$ uv pip install --group=docs --editable .

and then from the root of the repository do:

$ make -C docs html