From f31c2bbc88ddac65fd9cf95eb3897aff81a886cf Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 17:39:51 +0000 Subject: [PATCH 1/4] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.5.0...v6.0.0) - https://github.com/charliermarsh/ruff-pre-commit → https://github.com/astral-sh/ruff-pre-commit - [github.com/astral-sh/ruff-pre-commit: v0.1.6 → v0.15.18](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.6...v0.15.18) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1eb102d..c784496 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,10 +1,10 @@ exclude: 'docs|node_modules|migrations|.git|.tox' -default_stages: [commit] +default_stages: [pre-commit] fail_fast: true repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v6.0.0 hooks: - id: trailing-whitespace files: (^|/)a/.+\.(py|html|sh|css|js)$ @@ -12,9 +12,9 @@ repos: args: ["--maxkb=2000"] # Linting with ruff -- repo: https://github.com/charliermarsh/ruff-pre-commit +- repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: 'v0.1.6' + rev: 'v0.15.18' hooks: - id: ruff types_or: [ python, pyi, jupyter ] From 4f6f9e47df679aa6a1ef3936c3217f7b511e4348 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 17:39:59 +0000 Subject: [PATCH 2/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- test/test_aggregate.py | 3 ++- test/test_belongs_to.py | 3 ++- test/test_disaggregate.py | 1 + test/test_performance.py | 3 ++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/test/test_aggregate.py b/test/test_aggregate.py index afe6b55..ad14e28 100644 --- a/test/test_aggregate.py +++ b/test/test_aggregate.py @@ -1,7 +1,8 @@ import pytest -from gregor.aggregate import aggregate_point_to_polygon, aggregate_raster_to_polygon from numpy.testing import assert_array_equal +from gregor.aggregate import aggregate_point_to_polygon, aggregate_raster_to_polygon + def test_agg_tif_2x2(square_segmentation_2x2): agg_raster_poly = aggregate_raster_to_polygon( diff --git a/test/test_belongs_to.py b/test/test_belongs_to.py index f333c0a..0232d6b 100644 --- a/test/test_belongs_to.py +++ b/test/test_belongs_to.py @@ -1,6 +1,7 @@ -from gregor.disaggregate import get_belongs_to_matrix from numpy.testing import assert_array_equal +from gregor.disaggregate import get_belongs_to_matrix + def test_belongs_to_matrix_square_segmentation_2x2( dummy_raster, square_segmentation_2x2 diff --git a/test/test_disaggregate.py b/test/test_disaggregate.py index 39d2c97..b09d20f 100644 --- a/test/test_disaggregate.py +++ b/test/test_disaggregate.py @@ -1,4 +1,5 @@ import numpy as np + from gregor.disaggregate import ( disaggregate_polygon_to_point, disaggregate_polygon_to_raster, diff --git a/test/test_performance.py b/test/test_performance.py index 174222b..504826c 100644 --- a/test/test_performance.py +++ b/test/test_performance.py @@ -1,8 +1,9 @@ import numpy as np import pytest -from gregor.disaggregate import disaggregate_polygon_to_raster from memory_log import MemoryLogger +from gregor.disaggregate import disaggregate_polygon_to_raster + @pytest.mark.benchmark def test_performance_disaggregate_to_raster(large_raster, large_polygons): From 194a79ada4cba312564779c076f73a96ee879d80 Mon Sep 17 00:00:00 2001 From: jnnr <32454596+jnnr@users.noreply.github.com> Date: Wed, 24 Jun 2026 13:03:32 +0200 Subject: [PATCH 3/4] Let ruff re-format files --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c784496..808d664 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,8 +16,8 @@ repos: # Ruff version. rev: 'v0.15.18' hooks: - - id: ruff + - id: ruff-check types_or: [ python, pyi, jupyter ] - args: [--fix, --exit-non-zero-on-fix] + args: [--fix] - id: ruff-format types_or: [ python, pyi, jupyter ] From 52381733720fc4e6c3091fb293bd2377e4b4ad7c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 24 Jun 2026 11:03:43 +0000 Subject: [PATCH 4/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/gregor/disaggregate.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gregor/disaggregate.py b/src/gregor/disaggregate.py index 95dbc1e..b08cc4f 100644 --- a/src/gregor/disaggregate.py +++ b/src/gregor/disaggregate.py @@ -228,9 +228,9 @@ def disaggregate_polygon_to_point( ) # Make sure that it belongs to only one polygon - assert ( - points.belongs_to.apply(len).max() == 1 - ), "Every Point should belong to exactly one polygon." + assert points.belongs_to.apply(len).max() == 1, ( + "Every Point should belong to exactly one polygon." + ) points.belongs_to = points.belongs_to.apply(lambda x: x[0]) # Warn if there are polygons without points.