Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
29d60bc
Try use uv action
alexamici Jul 14, 2025
b5013d8
Fix actions/setup-python version
alexamici Jul 14, 2025
2a8f3cb
Simplify tipe check
alexamici Jul 14, 2025
be4ba85
Simplify integration tests
alexamici Jul 14, 2025
ad109f4
doc-build and simplify
alexamici Jul 14, 2025
68ecad5
Setup python is needed to use the .python-version file
alexamici Jul 14, 2025
e5b1e6c
Add doc dependencies to --dev
alexamici Jul 14, 2025
cd5ed08
Fix again wrong action version
alexamici Jul 14, 2025
bf77374
Less verbose tests
alexamici Jul 14, 2025
d243fda
Try simplify the minver
alexamici Jul 14, 2025
3e37b2e
Align minimum version to xarray
alexamici Jul 14, 2025
80fc14a
Update dependencies
alexamici Jul 14, 2025
244335a
Use uv for Make targets
alexamici Aug 19, 2025
6a4a60a
Merge remote-tracking branch 'origin/main' into uv-actions
alexamici Nov 6, 2025
2e6be04
Use xarray-sentinel 0.9.6rc1 for testing as it fixes a few bugs
alexamici Nov 6, 2025
479f5ed
Runc minver with python 3.11
alexamici Nov 6, 2025
3686779
Test doesn't fail anymore on GA
alexamici Nov 6, 2025
b78ffe5
Support first rasterio version pre-built for python 3.11
alexamici Nov 6, 2025
128f9ed
Code style
alexamici Nov 6, 2025
d6dddaa
Get minver almost fixed
alexamici Nov 6, 2025
c7af8c1
Hopefully get the first working version of typer
alexamici Nov 6, 2025
8351bcd
Released xarray-sentinel breaks with a few numpy versions
alexamici Nov 6, 2025
8d23ac6
Try again to fix minver
alexamici Nov 6, 2025
5272c3a
Ouch, rever botched update to uv.lock
alexamici Nov 6, 2025
7664a4e
Update pre-commit config
alexamici Nov 6, 2025
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
116 changes: 29 additions & 87 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,111 +28,60 @@ jobs:
python-version: 3.x
- uses: pre-commit/[email protected]

combine-environments:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install conda-merge
run: |
python -m pip install conda-merge
- name: Combine environments
run: |
for SUFFIX in ci integration; do
conda-merge ci/environment-$SUFFIX.yml environment.yml > ci/combined-environment-$SUFFIX.yml || exit
done
- uses: actions/upload-artifact@v4
with:
name: combined-environments
path: ci/combined-environment-*.yml

unit-tests:
name: unit-tests
needs: combine-environments
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.13']

steps:
- uses: actions/checkout@v5
- uses: actions/download-artifact@v5
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
name: combined-environments
path: ci
- name: Get current date
id: date
run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
- uses: mamba-org/setup-micromamba@v2
version: "0.7.20"
enable-cache: true
- name: "Set up Python"
uses: actions/setup-python@v5
with:
environment-file: ci/combined-environment-ci.yml
environment-name: DEVELOP
cache-environment: true
cache-environment-key: environment-${{ steps.date.outputs.date }}
cache-downloads-key: downloads-${{ steps.date.outputs.date }}
create-args: >-
python=${{ matrix.python-version }}
- name: Install package
run: |
python -m pip install --no-deps -e .
- name: Run tests
run: |
make unit-tests COV_REPORT=xml
python-version-file: ".python-version"
- name: Run unit tests
run: uv run --frozen -m pytest .

type-check:
needs: [combine-environments, unit-tests]
needs: [unit-tests]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5

- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
with:
version: "0.7.20"
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install the project
run: uv sync --locked --all-extras --dev
- name: Run tests
# For example, using `pytest`
run: uv run mypy .
- name: Run type checking
run: uv run --frozen -m mypy .

docs-build:
needs: [combine-environments, unit-tests]
needs: [unit-tests]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5
- uses: actions/download-artifact@v5
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
name: combined-environments
path: ci
- name: Get current date
id: date
run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
- uses: mamba-org/setup-micromamba@v2
version: "0.7.20"
enable-cache: true
- name: "Set up Python"
uses: actions/setup-python@v5
with:
environment-file: ci/combined-environment-ci.yml
environment-name: DEVELOP
cache-environment: true
cache-environment-key: environment-${{ steps.date.outputs.date }}
cache-downloads-key: downloads-${{ steps.date.outputs.date }}
create-args: >-
python=3.11
- name: Install package
run: |
python -m pip install --no-deps -e .
python-version-file: ".python-version"
- name: Build documentation
run: |
make docs-build
run: uv run --frozen make docs-build

integration-tests:
needs: [unit-tests]
Expand All @@ -142,23 +91,21 @@ jobs:
strategy:
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"

steps:
- uses: actions/checkout@v5

- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
with:
version: "0.7.20"
enable-cache: true
python-version: ${{ matrix.python-version }}

- name: Install the project
run: uv sync --locked --dev

- name: Run tests
run: uv run pytest -vv
- name: Run unit tests
run: uv run --frozen -m pytest .

minver-tests:
needs: [unit-tests]
Expand All @@ -171,14 +118,9 @@ jobs:

- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
python-version: "3.10"

- name: Install the project
run: uv sync --dev --resolution lowest-direct

- name: Run tests
run: uv run pytest -vv
run: uv run --resolution lowest-direct -p python3.11 -m pytest .

distribution:
runs-on: ubuntu-latest
Expand Down
13 changes: 6 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -12,28 +12,27 @@ repos:
- id: debug-statements
- id: mixed-line-ending
- repo: https://github.com/keewis/blackdoc
rev: v0.3.9
rev: v0.4.5
hooks:
- id: blackdoc
additional_dependencies: [black==23.11.0]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.9
rev: v0.14.3
hooks:
- id: ruff
args: [--fix, --show-fixes]
- id: ruff-format
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.22
rev: 1.0.0
hooks:
- id: mdformat
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.14.0
rev: v2.15.0
hooks:
- id: pretty-format-yaml
args: [--autofix, --preserve-quotes]
- id: pretty-format-toml
args: [--autofix]
- repo: https://github.com/gitleaks/gitleaks
rev: v8.25.1
rev: v8.29.0
hooks:
- id: gitleaks
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ COV_REPORT := html
default: qa unit-tests type-check

qa:
pre-commit run --all-files
uv run --frozen -m pre_commit run --all-files

unit-tests:
python -m pytest -vv --cov=. --cov-report=$(COV_REPORT) --doctest-glob="*.md" --doctest-glob="*.rst"
uv run --frozen -m pytest -vv --cov=. --cov-report=$(COV_REPORT) --doctest-glob="*.md" --doctest-glob="*.rst"

type-check:
python -m mypy .
uv run --frozen -m mypy .

conda-env-update:
$(CONDA) install -y -c conda-forge conda-merge
Expand All @@ -35,4 +35,4 @@ docs-build:


doc-test:
python -m pytest -vv --doctest-glob='*.md' README.md
uv run --frozen -m pytest -vv --doctest-glob='*.md' README.md
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ The following code applies the geometric terrain correction to the VV polarizati
```python
>>> import sarsen
>>> product = sarsen.Sentinel1SarProduct(
... "tests/data/S1B_IW_GRDH_1SDV_20211223T051122_20211223T051147_030148_039993_5371.SAFE",
... measurement_group="IW/VV",
... "tests/data/S1B_IW_GRDH_1SDV_20211223T051122_20211223T051147_030148_039993_5371.SAFE",
... measurement_group="IW/VV",
... )
>>> gtc = sarsen.terrain_correction(
... product,
... dem_urlpath="tests/data/Rome-30m-DEM.tif",
... product,
... dem_urlpath="tests/data/Rome-30m-DEM.tif",
... )

```
Expand All @@ -120,9 +120,9 @@ The radiometric correction can be activated using the key `correct_radiometry`:

```python
>>> rtc = sarsen.terrain_correction(
... product,
... dem_urlpath="tests/data/Rome-30m-DEM.tif",
... correct_radiometry="gamma_nearest"
... product,
... dem_urlpath="tests/data/Rome-30m-DEM.tif",
... correct_radiometry="gamma_nearest",
... )

```
Expand Down
23 changes: 14 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ requires = ["setuptools>=64", "setuptools_scm>=8"]
dev = [
"cfchecker>=4.1.0",
"mypy>=1.15.0",
"myst-parser>=4.0.1",
"pandas-stubs>=1.4.0",
"pre-commit>=4.3.0",
"pydata-sphinx-theme>=0.16.1",
"pytest>=7.0",
"pytest-cov>=5.0",
"setuptools>=64.0",
"shapely>=2.1",
"zarr>=2.18.3"
"sphinx-autoapi>=3.6.0",
"zarr>=2.18"
]

[project]
Expand All @@ -22,29 +26,30 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering"
]
dependencies = [
"attrs>=24.0",
"dask>=2023.2.0",
"flox>=0.9.13",
"numpy>=1.23.0",
"pandas>=1.4.0",
"dask>=2024.6",
"flox>=0.9",
"numpy>=1.26",
"pandas>=2.2",
"rasterio>=1.3.5",
"rioxarray>=0.15.0",
"typer>=0.11",
"scipy>=1.13",
"typer>=0.16",
"xarray>=2023.12.0",
"xarray-sentinel>=0.9.3"
"xarray-sentinel>=0.9.6rc1"
]
description = "Algorithms and utilities for Synthetic Aperture Radar (SAR) sensors"
dynamic = ["version"]
license = {file = "LICENSE"}
name = "sarsen"
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.11"

[project.scripts]
sarsen = "sarsen.__main__:app"
Expand Down
2 changes: 0 additions & 2 deletions tests/test_60_main.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import pytest
from typer.testing import CliRunner

from sarsen import __main__

runner = CliRunner()


@pytest.mark.xfail()
def test_main() -> None:
res = runner.invoke(__main__.app, ["gtc", "--help"])
assert res.exit_code == 0
Expand Down
Loading