We welcome contributions! Whether it's a bug fix, new engine, satellite source, or documentation improvement, here's how to get started.
git clone https://github.com/montimaj/agribound.git
cd agribound
conda create -n agribound python=3.12 gdal rasterio geopandas fiona shapely pyproj -c conda-forge
conda activate agribound
pip install -e ".[all,dev,docs]"
# Required for DA instance segmentation on Sentinel-2
git clone https://github.com/fieldsoftheworld/ftw-baselines.git ../ftw-baselines
pip install -e ../ftw-baselines# All tests (excluding GPU and GEE)
pytest -m "not gpu and not gee"
# With coverage
pytest --cov=agribound --cov-report=html
# Only fast tests
pytest -m "not slow"Test markers: gpu (requires CUDA), gee (requires GEE auth), slow (long-running).
We use Ruff for linting and formatting (config in pyproject.toml):
ruff check agribound/ examples/ tests/
ruff format agribound/- Target: Python 3.10+
- Line length: 100
- Rules: E, F, W, I, N, UP, B, SIM
-
Create
agribound/engines/my_engine.pyimplementingDelineationEngine:from agribound.engines.base import DelineationEngine from agribound.config import AgriboundConfig import geopandas as gpd class MyEngine(DelineationEngine): name = "my-engine" supported_sources = ["sentinel2", "local"] requires_bands = ["R", "G", "B"] def delineate(self, raster_path: str, config: AgriboundConfig) -> gpd.GeoDataFrame: ...
-
Register in
agribound/engines/base.py(ENGINE_REGISTRY+get_engine()) -
Add engine name to
VALID_ENGINESinagribound/config.py -
Add optional dependencies in
pyproject.toml -
Write tests in
tests/ -
Add an example script in
examples/
- Register in
agribound/composites/base.py(SOURCE_REGISTRY) - Add source name to
VALID_SOURCESinagribound/config.py - Implement cloud masking (if GEE-based) in
agribound/composites/gee.py - Add a factory branch in
get_composite_builder()if needed
pip install agribound[docs]
mkdocs serve # local preview at http://127.0.0.1:8000
mkdocs build # build static site- Create a feature branch from
main - Keep PRs focused — one feature or fix per PR
- Add tests for new functionality
- Run
ruff checkandpytestbefore submitting - Update documentation and examples if applicable
- Follow existing code patterns and naming conventions
Please open an issue on GitHub with:
- A clear description of the problem
- Steps to reproduce
- Python version, OS, and agribound version (
agribound --version) - Full error traceback