Contributing

This page provides a guide for developers wishing to contribute to spikify.

Bugs, Features and PRs

For bug reports, technical feature requests, feature ideas, and questions, please use our issue tracker: https://github.com/neuromorphic-polito/spikify/issues

If you have already created a PR, you can send it in. Our CI workflow will check (test and code styles) and a maintainer will perform a review, before we can merge it. Your PR and Commit Messages should conform with the following rules:

  • A meaningful description or link, which describes the change

  • The changed code (for sure :) )

  • Test cases for the change (important!)

  • Updated documentation, if behavior gets changed or new options/directives are introduced.

  • Update of docs/changelog.rst.

  • Commit your code following the Conventional Commits standard.

  • If this is your first PR, feel free to add your name in the AUTHORS file.

In the next sections you will find a detailed guide on how to contribute to the project.

Set up the Project

  1. Fork the project repository to your own GitHub account, clone your fork and configure the remotes.
    # Clone the repository from your personal fork into the current directory
    git clone https://github.com/<your-username>/spikify.git
    # Go to the recently cloned folder.
    cd spikify
    # Set the original repository as a remote named "upstream."
    git remote add upstream https://github.com/neuromorphic-polito/spikify.git
    
  2. If it has been some time since you initially cloned, ensure you obtain the most recent updates from the upstream source.:
    git checkout <remote-branch-name>
    git pull upstream <remote-branch-name>
    
  3. Create a new branch where you’ll develop your feature, change or fix. Name it descriptively to reflect the nature of your work (feat, fix, test, refactor).
    git checkout -b <your-branch-name>
    

Install Dependencies

  1. spikify uses Poetry to manage the project dependencies, so you need to install it first.
    pip install poetry
    
  2. Install project dependencies.
    poetry install --all-extras
    
  3. Install the pre-commit hooks to run the formatting and linting suite.
    pre-commit install
    

Run Tests

  1. spikify use Pytest to run unit tests on the project and Codecov to generate the coverage report.
    # To run unit tests
    poetry run pytest
    
  2. To generate the coverage report, run the following command:
    # To generate the coverage report
    poetry run pytest --cov=spikify --cov-report=xml
    

Build Documentation

  1. For documentation, follow the Sphinx docstrings format.
    # To build the documentation
    cd docs
    poetry run make html
    

Linting & Formatting

  1. spikify uses pre-commit hooks to ensure that the code is formatted and linted according to the project’s standards.
    # To run the pre-commit hooks
    pre-commit run --all-files
    

Authors

Benedetto Leto <benedetto.leto@polito.it>

Gianvito Urgese <gianvito.urgese@polito.it>

Vittorio Fra <vittorio.fra@polito.it>

Riccardo Pignari <riccardo.pignari@polito.it>