Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,49 @@ jobs:
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# verbose: true # optional (default = false)

test-rusterize:
name: rusterize, py=${{ matrix.python-version }}

strategy:
matrix:
python-version: ["3.11", "3.13"]
os: ["ubuntu-latest"]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # grab all branches and tags
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install Hatch
run: |
python -m pip install --upgrade pip
pip install hatch
- name: Restore cached hypothesis directory
id: restore-hypothesis-cache
uses: actions/cache/restore@v4
with:
path: .hypothesis/
key: cache-hypothesis-${{ runner.os }}-${{ github.run_id }}
restore-keys: |
cache-hypothesis-
- name: Set Up Hatch Env
run: |
hatch env create test-rusterize.py${{ matrix.python-version }}
hatch env run -e test-rusterize.py${{ matrix.python-version }} list-env
- name: Run Tests
run: |
hatch env run --env test-rusterize.py${{ matrix.python-version }} run-coverage

- name: Save cached hypothesis directory
id: save-hypothesis-cache
if: always()
uses: actions/cache/save@v4
with:
path: .hypothesis/
key: cache-hypothesis-${{ runner.os }}-${{ github.run_id }}
60 changes: 60 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dynamic=["version"]
[project.optional-dependencies]
dask = ["dask-geopandas"]
rasterize = ["rasterio"]
rusterize = ["rusterize"]
exactextract = ["exactextract", "sparse"]
test = [
"geodatasets",
Expand All @@ -48,6 +49,27 @@ test = [
"netCDF4",
"hypothesis",
]
test-rusterize = [
"geodatasets",
"pooch",
"dask-geopandas",
"rusterize",
"exactextract",
"sparse",
"netCDF4",
"hypothesis",
]
test-all = [
"geodatasets",
"pooch",
"dask-geopandas",
"rasterio",
"rusterize",
"exactextract",
"sparse",
"netCDF4",
"hypothesis",
]
docs = [
"geodatasets",
"pooch",
Expand Down Expand Up @@ -110,6 +132,44 @@ run-verbose = "run-coverage --verbose"
run-mypy = "mypy src"
list-env = "pip list"

[tool.hatch.envs.test-rusterize]
dependencies = [
"coverage",
"pytest",
"pytest-cov",
"pytest-xdist"
]
features = ["test-rusterize"]

[[tool.hatch.envs.test-rusterize.matrix]]
python = ["3.11", "3.13"]

[tool.hatch.envs.test-rusterize.scripts]
run-coverage = "pytest -nauto --cov-config=pyproject.toml --cov=pkg --cov-report xml --cov=src --junitxml=junit.xml -o junit_family=legacy"
run-coverage-html = "pytest -nauto --cov-config=pyproject.toml --cov=pkg --cov-report html --cov=src"
run-pytest = "run-coverage --no-cov"
run-verbose = "run-coverage --verbose"
list-env = "pip list"

[tool.hatch.envs.test-all]
dependencies = [
"coverage",
"pytest",
"pytest-cov",
"pytest-xdist"
]
features = ["test-all"]

[[tool.hatch.envs.test-all.matrix]]
python = ["3.13"]

[tool.hatch.envs.test-all.scripts]
run-coverage = "pytest -nauto --cov-config=pyproject.toml --cov=pkg --cov-report xml --cov=src --junitxml=junit.xml -o junit_family=legacy"
run-coverage-html = "pytest -nauto --cov-config=pyproject.toml --cov=pkg --cov-report html --cov=src"
run-pytest = "run-coverage --no-cov"
run-verbose = "run-coverage --verbose"
list-env = "pip list"

[tool.ruff.lint]
# E402: module level import not at top of file
# E501: line too long - let black worry about that
Expand Down
5 changes: 5 additions & 0 deletions src/rasterix/rasterize/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Rasterization API
from .core import geometry_mask, rasterize
from .rasterio import geometry_clip

__all__ = ["rasterize", "geometry_mask", "geometry_clip"]
Loading
Loading