From 37db8d5361e90971fc4f02d2779ef43034fd958b Mon Sep 17 00:00:00 2001 From: Sergio Souza Costa Date: Thu, 2 Jul 2026 08:57:59 -0300 Subject: [PATCH] fix(mypy): bump python_version to 3.12 to parse NumPy 2.x stubs, add missing annotations --- dissmodel/geo/raster/backend.py | 4 ++-- dissmodel/io/raster.py | 2 +- pyproject.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dissmodel/geo/raster/backend.py b/dissmodel/geo/raster/backend.py index 004ae43..82d8a58 100644 --- a/dissmodel/geo/raster/backend.py +++ b/dissmodel/geo/raster/backend.py @@ -607,8 +607,8 @@ def focal_sum_mask( ------- np.ndarray int """ - result = np.zeros(self.shape, dtype=int) - m = mask.astype(np.int8) + result: np.ndarray = np.zeros(self.shape, dtype=int) + m: np.ndarray = mask.astype(np.int8) for dr, dc in neighborhood: result += self.shift2d(m, dr, dc) return result diff --git a/dissmodel/io/raster.py b/dissmodel/io/raster.py index 28d887e..052f43a 100644 --- a/dissmodel/io/raster.py +++ b/dissmodel/io/raster.py @@ -203,7 +203,7 @@ def _write_geotiff( rows, cols = backend.shape if band_spec: - arrays = [] + arrays: list[np.ndarray] = [] for name, dtype, nodata in band_spec: arr = backend.arrays.get( name, diff --git a/pyproject.toml b/pyproject.toml index edab353..17434e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -121,7 +121,7 @@ exclude = ["docs", "site", "build"] pythonpath = ["."] [tool.mypy] -python_version = "3.10" +python_version = "3.12" ignore_missing_imports = true exclude = ["tests/", "docs/", "examples/"]