Contributing#
We welcome contributions to the LazySlide project. This document provides guidelines for contributing to the project.
Project overview#
LazySlide is a modularized and scalable whole slide image analysis toolkit. The project is structured as follows:
src/lazyslide: Main package codetests: Test filesdocs: Documentation
For core contributors#
Please do not commit directly to the main branch.
Instead, create a new branch for your changes and submit a pull request.
Set up development environment#
We use uv to manage our development environment. Please make sure you have it installed before proceeding.
Clone the repository:
git clone https://github.com/rendeirolab/lazyslide.git # or gh repo clone rendeirolab/lazyslide
Checkout a new branch:
git checkout -b my-new-branch
We use uv to manage our development environment:
uv lock uv run pre-commit install
We use pre-commit to run code formatting and linting checks before each commit.
Start an IPython/Jupyter session:
uv run –with ipython ipython # or uv run –with jupyter jupyter lab
Make your changes.
Testing#
LazySlide uses pytest for testing. Tests are located in the tests directory.
To run all tests:
uv run task test
To run a specific test file:
uv run python -m pytest tests/test_example.py
When adding new tests:
Create a new file in the
testsdirectory with a name starting withtest_.Import pytest and the module you want to test.
Write test functions with names starting with
test_.Use assertions to verify expected behavior.
Code style and development guidelines#
LazySlide uses ruff for both linting and formatting.
The configuration is defined in pyproject.toml and enforced through pre-commit hooks.
To format code:
uv run task fmt
# or
ruff format docs/source src/lazyslide tests
Documentation#
Documentation is built using Sphinx and is located in the docs directory.
To build the documentation:
# Build doc with cache
uv run task doc-build
# Fresh build
uv run task doc-clean-build
To serve the documentation locally:
uv run task doc-serve
This will start a local server at http://localhost:8000.
Documentation is written in reStructuredText (.rst) and Jupyter notebooks (.ipynb) using the myst-nb extension.
Submitting changes#
Commit your changes and push them to your branch.
Create a pull request on GitHub.
Ensure all CI checks pass.
Wait for a review from a maintainer.
Reporting issues#
If you encounter a bug or have a feature request, please open an issue on the GitHub repository.
When reporting a bug, please include:
A clear description of the issue
Steps to reproduce the problem
Expected behavior
Actual behavior
Any relevant logs or error messages
Your environment (OS, Python version, package versions)