Contributing¶
1. Contributor License Agreement (CLA)¶
When you make your first contribution to this project, you will be automatically prompted to sign our Contributor License Agreement (CLA) through GitHub. This is a one-time process that you'll need to complete before your contributions can be accepted.
By signing the CLA, you agree to:
- Grant perpetual, worldwide, non-exclusive licenses for copyright and patent
- Represent that you have the rights to contribute, originality, and will disclose third-party restrictions
- Provide contributions "AS IS" without warranties
The agreement will be presented automatically through GitHub's interface when you make your first pull request.
2. How to contribute¶
2.1. Coding Standards¶
- Follow PEP 8 and PEP 257 guidelines
- Use snake_case naming convention
- Prefer one class per file
- Aim for simple and flexible API design
- Maintain 100% test coverage
2.2. Contributing Process¶
- Write local/unit tests for your changes
- Include examples when adding new features
- Submit a pull request with your changes
2.3. Issue Guidelines¶
When reporting issues: - Provide clear reproduction steps - Describe expected behavior - Include PLAID version information - Attach relevant logs
For feature requests: - Describe the feature in detail - Explain the use cases - Provide examples if possible
3. Development setup¶
3.1. Prerequisites¶
- Git
- Python (
>=3.10, <3.14) - Conda or uv package manager
3.2. Installation Steps¶
- Clone the repository:
-
Configure the development environment:
- Using conda (Windows, macOS and Linux):
- Using uv (Linux):
4. Tests and examples¶
To check the installation, you can run the unit test suite:
To test further and learn about simple use cases, you can run and explore the examples:
5. Documentation¶
The documentation is built with Zensical and the mkdocstrings Python handler. To compile it locally, run:
Various notebooks are executed during compilation. The documentation can then
be explored in docs/_build/html.
When you add, rename, or remove a Python module under src/plaid, regenerate
the API reference:
The script writes minimal mkdocstrings stubs under docs/source/api and
rewrites the API reference nav block in docs/zensical.toml (between
the AUTO-GENERATED API REFERENCE markers). CI (Documentation workflow)
re-runs the script and fails if the working tree is not clean, so both the
stubs and the navigation stay in sync with the source layout. The script is
also invoked automatically at the start of bash docs/generate_doc.sh.
6. Formatting and linting with Ruff¶
We use Ruff for linting and formatting.
The configuration is defined in ruff.toml, and some folders like docs/ and examples/ are excluded from checks.
You can run Ruff manually as follows:
ruff --config ruff.toml check . --fix # auto-fix linting issues
ruff --config ruff.toml format . # auto-format code
7. Setting up pre-commit¶
Pre-commit is configured to run the following hooks:
- Ruff check
- Ruff format
- Pytest
The selected hooks are defined in the .pre-commit-config.yaml file.
To run all hooks manually on the full codebase:
You can also run (once):
8. Release process¶
8.1. Github¶
- Create a new release branch from
maincalled e.g.release_0.1.10 -
Update the CHANGELOG
- Rename the section [Unreleased] to the new version number (e.g., [0.1.10]) followed by the release date (YYYY-MM-DD)
- Update links at the end of the file
-
Create a pull request and request reviews
- Once approved, merge the pull request
- Tag the release (e.g.,
git tag 0.1.10). Important: pull the recently updatedmainbranch before creating the tag. -
Create a new release on GitHub
- Click
Generate release notes - Include a link to the CHANGELOG file at the release tag, e.g.:
https://github.com/PLAID-lib/plaid/blob/0.1.10/CHANGELOG.md
- Click
-
Create a new pull request to add a new
Unreleasedsection to the CHANGELOG, with sub-sectionsAdded,Changed,Fixes,Removed
8.2. conda-forge¶
- Create a fork of https://github.com/conda-forge/plaid-feedstock or sync with the latest changes if you already have a fork
-
Update the conda-forge recipe
plaid-feedstock/recipe/meta.yaml- Update the
versionfield to the new version number (line 1) - Update the SHA256 checksum for the new version (line 9), you can find it in the GitHub action: https://github.com/PLAID-lib/plaid/actions/workflows/checksum_release.yml, don’t take the one in
Digestsection ofArtifacts, but take the one in the download button - Update requirements section if they change in the new version
- Update the
-
Submit a pull request to the conda-forge feedstock repository
- Follow the instructions provided in the PR message
8.3. Readthedocs¶
Just check a version was created for the release tag, it should have automatically triggered a new build on Read the Docs.
9. Documentation consistency checks¶
Before opening a PR that modifies docs or public APIs, run a quick consistency pass:
-
Build docs locally
-
Validate API references
- Ensure documented methods/classes exist in current source.
- Ensure renamed/removed APIs are either removed from docs or explicitly marked as legacy.
-
Validate code snippets/imports
- Verify documented imports execute against the current package.
- Prefer snippets that reflect maintained modules under
src/plaid.
-
Validate storage-layout claims
- Ensure on-disk format docs match current
plaid.storagebehavior. - Cross-check against tests/fixtures when updating storage documentation.
- Ensure on-disk format docs match current