Skip to content

Contributing ๐Ÿ‘

Guidelines ๐Ÿ’ก

We welcome contributions to the library! If you have a bug fix or new feature that you would like to contribute, please follow the steps below:

  1. Check the existing issues and/or open a new one to discuss the problem and potential solutions.
  2. Fork the repository on GitHub.
  3. Clone the repository to your local machine.
  4. Create a new branch for your bug fix or feature.
  5. Make your changes and test them thoroughly, making sure that it passes all current tests.
  6. Commit your changes and push the branch to your fork.
  7. Open a pull request on the main repository.

Submitting Pull Requests ๐ŸŽฏ

When submitting a pull request, please make sure that you've followed the steps above and that your code has been thoroughly tested. Also, be sure to include a brief summary of the changes you've made and a reference to any issues that your pull request resolves.

Code formatting ๐Ÿš€

timebasedcv uses ruff for both formatting and linting. Specific settings are declared in the pyproject.toml file.

To format the code, you can run the following commands:

make lint
ruff version
ruff format timebasedcv tests
ruff check timebasedcv tests --fix
ruff clean

As part of the checks on pull requests, it is checked whether the code follows those standards. To ensure that the standard is met, it is recommended to install pre-commit hooks:

python -m pip install pre-commit
pre-commit install

Developing ๐Ÿ

Let's suppose that you already did steps 1-4 from the above list, now you should install the library and its developing dependencies in editable way.

First move into the repo folder: cd timebasedcv.

Then:

make init-dev
pip install -e ".[all-dev]" --no-cache-dir
pre-commit install

Now you are ready to proceed with all the changes you want to!

Testing ๐Ÿงช

Once you are done with changes, you should:

  • add tests for the new features in the /tests folder
  • make sure that new features do not break existing codebase by running tests:

    make test
    
    pytest tests -n auto
    

Docs ๐Ÿ“‘

The documentation is generated using mkdocs-material, the API part uses mkdocstrings.

If a new feature or a breaking change is developed, then we suggest to update documentation in the /docs folder as well, in order to describe how this can be used from a user perspective.