Contribute to YASA#

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

If you like YASA, you can also consider buying the developers a coffee!

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 code formatting. Before submitting a PR, please make sure to run the following command in the root folder of YASA:

    $ ruff format --line-length=100
    
  • 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:

$ pip install yasa[docs]

and then within the yasa/docs directory do:

$ sphinx-build -M html . ./build