Skip to content

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ΒΆ

[Paste the full traceback here]
### ✨ 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:

conda create -n gee_acolite python=3.11
conda activate gee_acolite
pip install -e .

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:

python tests/test_tiled_mode.py

For notebook-based tests, open the relevant notebook in tests/tests/ or tests/SDB/ and run all cells. GEE authentication is required:

import ee
ee.Authenticate()
ee.Initialize(project="your-project-id")

When contributing new functionality, add a minimal notebook or extend an existing one demonstrating the expected behaviour.

Contribution WorkflowΒΆ

  1. Fork the repository on GitHub
  2. Create a branch for your change:
    git checkout -b feat/my-new-feature
    
  3. Commit using Conventional Commits:
    git commit -m "feat(bathymetry): add multi-band SDB calibration"
    
  4. Push to your fork:
    git push origin feat/my-new-feature
    
  5. Open a Pull Request against main

Commit ConventionΒΆ

We follow Conventional Commits:

<type>(<scope>): <description>

[optional body]

[optional footer(s)]

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ΒΆ

  1. Create a .md file in docs/
  2. Register it in mkdocs.yml under nav:
nav:
  - Section:
      - New Page: path/to/page.md

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?ΒΆ

import ee
ee.Authenticate()            # only needed once
ee.Initialize(project="your-cloud-project")

See the GEE Python quickstart for full instructions.

My ACOLITE submodule is empty β€” what do I do?ΒΆ

git submodule update --init --recursive

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!