ContributingΒΆ
Thank you for considering contributing to GEE ACOLITE! This guide explains how to report issues, propose features, and submit code or documentation improvements.
Ways to ContributeΒΆ
π Report BugsΒΆ
Before opening a new issue, check whether it has already been reported in Issues. If not, create one including:
- A clear description of the problem
- Minimal reproducible code
- Full traceback
- Environment details (see template below)
Issue Template:
### Bug Description
[Clear and concise description]
### Steps to Reproduce
1. ...
2. ...
3. ...
### Expected Behavior
[What you expected to happen]
### Actual Behavior
[What actually happened]
### Environment
- OS: [e.g., Ubuntu 22.04, Windows 11]
- Python: [e.g., 3.11.0]
- gee_acolite: [e.g., 1.2.0]
- ACOLITE: [e.g., 20231023]
- earthengine-api: [e.g., 0.1.390]
### Reproducible Code
```python
# Minimal code to reproduce the error
TracebackΒΆ
### β¨ Request Features
Open a [GitHub Issue](https://github.com/Aouei/gee_acolite/issues) and describe:
1. The use case and motivation
2. The expected behavior
3. A usage example if possible
### π Improve Documentation
- Fix typos or unclear explanations
- Add usage examples or notebooks
- Improve API docstrings
### π» Contribute Code
See the [Development](#development) section below.
## Development
### Setting Up the Development Environment
GEE ACOLITE uses ACOLITE as a Git submodule. Make sure to initialise it after cloning:
```bash
# Fork and clone
git clone https://github.com/your-username/gee_acolite.git
cd gee_acolite
# Initialise the ACOLITE submodule
git submodule update --init --recursive
# Create and activate a virtual environment (Python >= 3.11 required)
python -m venv venv
source venv/bin/activate # Linux / macOS
venv\Scripts\activate # Windows
# Install the package in development mode
pip install -e .
# Optional: install visualisation dependencies
pip install -e ".[viz]"
Conda users
If you use conda, you can create an environment with:
Project StructureΒΆ
gee_acolite/
βββ gee_acolite/ # Source code
β βββ __init__.py
β βββ correction.py # ACOLITE class β main DSF workflow
β βββ water_quality.py # Water quality products (SPM, Chl-a, Rrsβ¦)
β βββ bathymetry.py # Satellite-derived bathymetry (SDB)
β βββ utils/
β β βββ l1_convert.py # DN β TOA, geometry, resampling
β β βββ masks.py # Water / cloud / shadow masking
β β βββ search.py # Sentinel-2 search + cloud probability
β βββ sensors/
β βββ sentinel2.py # Band definitions and scale groups
βββ ACOLITE/ # Git submodule (Vanhellemont)
βββ tests/ # Notebooks and scripts for manual testing
βββ docs/ # MkDocs documentation
βββ pyproject.toml # Package configuration
βββ README.md
Code StyleΒΆ
We follow PEP 8. Use NumPy-style docstrings and type hints:
# Import order: stdlib β third-party β GEE β local
import os
import numpy as np
import scipy.interpolate
import ee
from gee_acolite.utils import masks
def compute_rrs(image: ee.Image, settings: dict) -> ee.Image:
"""
Convert surface reflectance to remote sensing reflectance.
Parameters
----------
image : ee.Image
L2W image containing ``rhos_B*`` bands.
settings : dict
ACOLITE settings dictionary.
Returns
-------
ee.Image
Image with ``Rrs_B*`` bands added.
Examples
--------
>>> rrs_image = compute_rrs(l2w_image, settings)
"""
...
TestingΒΆ
Tests are organised as Jupyter notebooks under tests/ and one standalone script
(tests/test_tiled_mode.py). To run the script:
For notebook-based tests, open the relevant notebook in tests/tests/ or tests/SDB/
and run all cells. GEE authentication is required:
When contributing new functionality, add a minimal notebook or extend an existing one demonstrating the expected behaviour.
Contribution WorkflowΒΆ
- Fork the repository on GitHub
- Create a branch for your change:
- Commit using Conventional Commits:
- Push to your fork:
- Open a Pull Request against
main
Commit ConventionΒΆ
We follow Conventional Commits:
Types:
| Type | When to use |
|---|---|
feat |
New feature |
fix |
Bug fix |
docs |
Documentation only |
refactor |
Code change with no new feature or fix |
test |
Add or update tests |
chore |
Maintenance (deps, CI, tooling) |
Release tags (append to commit message to trigger version bump in CI):
| Tag | Effect |
|---|---|
[release-patch] |
Bumps patch version (1.2.0 β 1.2.1) |
[release-minor] |
Bumps minor version (1.2.0 β 1.3.0) |
[skip ci] |
Skips CI entirely |
Examples:
feat(water_quality): add Dogliotti turbidity for B5
fix(correction): handle NaN values in dark spectrum retrieval
docs(api): update ACOLITE.correct() return type description
chore: bump earthengine-api dependency to >=0.1.390 [release-patch]
Pull Request GuidelinesΒΆ
Checklist before opening a PR:
- [ ] Code follows PEP 8
- [ ] New functionality has a test notebook or script
- [ ] Docstrings are complete and use NumPy style
- [ ] Documentation updated if public API changed
- [ ] All existing tests/notebooks still work
PR Template:
## Description
[What does this PR change and why?]
## Type of change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation / refactor
## How to Test
[Steps or notebook to verify the change]
## Related Issues
Closes #[issue number]
DocumentationΒΆ
Build LocallyΒΆ
pip install mkdocs mkdocs-material mkdocstrings[python] mkdocs-mermaid2-plugin
# Live preview with auto-reload
mkdocs serve
# β http://127.0.0.1:8000
Add a New PageΒΆ
- Create a
.mdfile indocs/ - Register it in
mkdocs.ymlundernav:
AdmonitionsΒΆ
Use MkDocs Material admonitions to highlight important information:
!!! note "GEE initialisation"
Always call `ee.Initialize(project=...)` before using any GEE functionality.
!!! warning "ACOLITE submodule"
ACOLITE must be initialised with `git submodule update --init --recursive`.
!!! tip "Dark spectrum"
The `getInfo()` call for the dark spectrum is the only client-side bottleneck
per image. Keep the collection small to reduce processing time.
CommunityΒΆ
Code of ConductΒΆ
- Be respectful and constructive
- Accept and give feedback in good faith
- Focus on what is best for the project and its users
CommunicationΒΆ
- GitHub Issues: Bug reports and feature requests
- GitHub Discussions: Questions, ideas, and general conversation
Frequently Asked QuestionsΒΆ
Do I need to know ACOLITE internals to contribute?ΒΆ
No. Most contributions involve GEE-side code (correction.py, water_quality.py,
bathymetry.py) which does not require deep knowledge of ACOLITE. The ACOLITE
interaction is isolated to LUT loading and dark spectrum retrieval in correction.py.
What Python version is required?ΒΆ
Python >= 3.11 is required, matching the requires-python constraint in pyproject.toml.
How do I authenticate with GEE?ΒΆ
See the GEE Python quickstart for full instructions.
My ACOLITE submodule is empty β what do I do?ΒΆ
If you cloned without --recurse-submodules, the ACOLITE/ directory will be empty
until you run the command above.
Thank you for contributing to GEE ACOLITE!