Developer Guide

Setup

  1. Create a fork of wxee.

  2. Download and install the package and developer dependencies from your fork.

    git clone https://github.com/{username}/wxee
    cd wxee
    pip install hatch
    hatch run -e test pre-commit install
    
  3. Create a new feature branch.

    git checkout -b {feature-name}
    
  4. Write features and tests and commit them (all pre-commit checks must pass). Add NumPy-style docstrings and type hints for any new functions, methods, or classes.

    git add {modified file(s)}
    git commit -m "{commit message}"
    
  5. Rebuild documentation when docstrings are added or changed.

    hatch run docs:build
    hatch run docs:view
    

Tests

Writing Tests

All new functionality should be tested. Tests that require Earth Engine to be initialized should use the @pytest.mark.ee decorator which allows them to be easily skipped in case of connection issues.

For example:

import pytest

@pytest.mark.ee
def test_number_is_10():
    num = ee.Number(10)
    assert num.getInfo() == 10

Running Tests

To run all tests, use hatch run test:all. If you cannot connect to Earth Engine or would like to skip slower tests, use hatch run test:local.