From 4b3b69af1662dbaeef9c9dccef2240134474bcd4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Jul 2026 16:30:36 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.15.15 → v0.15.20](https://github.com/astral-sh/ruff-pre-commit/compare/v0.15.15...v0.15.20) - [github.com/scientific-python/cookie: 2026.04.04 → 2026.06.18](https://github.com/scientific-python/cookie/compare/2026.04.04...2026.06.18) - [github.com/MarcoGorelli/cython-lint: v0.19.0 → v0.21.0](https://github.com/MarcoGorelli/cython-lint/compare/v0.19.0...v0.21.0) - [github.com/woodruffw/zizmor-pre-commit: v1.25.2 → v1.26.1](https://github.com/woodruffw/zizmor-pre-commit/compare/v1.25.2...v1.26.1) - [github.com/rbubley/mirrors-prettier: v3.8.3 → v3.9.4](https://github.com/rbubley/mirrors-prettier/compare/v3.8.3...v3.9.4) - [github.com/numpy/numpydoc: v1.10.0 → v1.11.0rc0](https://github.com/numpy/numpydoc/compare/v1.10.0...v1.11.0rc0) --- .pre-commit-config.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fe24c034..f26b1f03 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -55,13 +55,13 @@ repos: # Enforce that all noqa annotations always occur with specific codes. - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.15.15' + rev: 'v0.15.20' hooks: - id: ruff-check args: ['--fix', '--show-fixes'] - repo: https://github.com/scientific-python/cookie - rev: 2026.04.04 + rev: 2026.06.18 hooks: - id: sp-repo-review @@ -83,17 +83,17 @@ repos: args: ['--ignore', 'E501,W503'] - repo: https://github.com/MarcoGorelli/cython-lint - rev: v0.19.0 + rev: v0.21.0 hooks: - id: cython-lint - repo: https://github.com/woodruffw/zizmor-pre-commit - rev: v1.25.2 + rev: v1.26.1 hooks: - id: zizmor - repo: https://github.com/rbubley/mirrors-prettier - rev: v3.8.3 + rev: v3.9.4 hooks: - id: prettier types_or: [css, rst, json, yaml, toml, markdown] @@ -110,7 +110,7 @@ repos: - tomli - repo: https://github.com/numpy/numpydoc - rev: v1.10.0 + rev: v1.11.0rc0 hooks: - id: numpydoc-validation exclude: 'extern/' From a3d996d50124a7d2f205bef7af3100a2440ba3f6 Mon Sep 17 00:00:00 2001 From: Larry Bradley Date: Mon, 6 Jul 2026 12:51:00 -0400 Subject: [PATCH 2/2] Prefix Cython loop variables with underscore --- regions/_geometry/circle_overlap.pyx | 6 +++--- regions/_geometry/ellipse_overlap.pyx | 6 +++--- regions/_geometry/polygon_overlap.pyx | 6 +++--- regions/_geometry/rectangle_overlap.pyx | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/regions/_geometry/circle_overlap.pyx b/regions/_geometry/circle_overlap.pyx index f744744f..c15ce93f 100644 --- a/regions/_geometry/circle_overlap.pyx +++ b/regions/_geometry/circle_overlap.pyx @@ -155,7 +155,7 @@ cdef double circle_overlap_single_subpixel(double x0, double y0, Return the fraction of overlap between a circle and a single pixel with given extent, using a sub-pixel sampling method. """ - cdef unsigned int i, j + cdef unsigned int _i, _j cdef double x, y, dx, dy, r_squared cdef double frac = 0.0 # accumulator @@ -164,10 +164,10 @@ cdef double circle_overlap_single_subpixel(double x0, double y0, r_squared = r ** 2 x = x0 - 0.5 * dx - for i in range(subpixels): + for _i in range(subpixels): x += dx y = y0 - 0.5 * dy - for j in range(subpixels): + for _j in range(subpixels): y += dy if x * x + y * y < r_squared: frac += 1.0 diff --git a/regions/_geometry/ellipse_overlap.pyx b/regions/_geometry/ellipse_overlap.pyx index a40ab9df..f2bd031c 100644 --- a/regions/_geometry/ellipse_overlap.pyx +++ b/regions/_geometry/ellipse_overlap.pyx @@ -159,7 +159,7 @@ cdef double ellipse_overlap_single_subpixel(double x0, double y0, Return the fraction of overlap between an ellipse and a single pixel with given extent, using a sub-pixel sampling method. """ - cdef unsigned int i, j + cdef unsigned int _i, _j cdef double x, y cdef double frac = 0.0 # Accumulator. cdef double inv_rx_sq, inv_ry_sq @@ -175,10 +175,10 @@ cdef double ellipse_overlap_single_subpixel(double x0, double y0, inv_ry_sq = 1.0 / (ry * ry) x = x0 - 0.5 * dx - for i in range(subpixels): + for _i in range(subpixels): x += dx y = y0 - 0.5 * dy - for j in range(subpixels): + for _j in range(subpixels): y += dy # Transform into frame of rotated ellipse diff --git a/regions/_geometry/polygon_overlap.pyx b/regions/_geometry/polygon_overlap.pyx index 247470fe..3575138a 100644 --- a/regions/_geometry/polygon_overlap.pyx +++ b/regions/_geometry/polygon_overlap.pyx @@ -384,7 +384,7 @@ cdef double polygon_overlap_single_subpixel(double x0, double y0, driver), including from multiple threads on free-threaded Python builds. """ - cdef int i, j, e, prev, m, a, b, ptr, h, hh + cdef int _i, _j, e, prev, m, a, b, ptr, h, hh cdef double x, y, dx, dy, hits cdef double xi, yi, xj, yj, tmp cdef bint inside @@ -404,7 +404,7 @@ cdef double polygon_overlap_single_subpixel(double x0, double y0, # Subpixel sampling (subpixels > 1): scanline parity fill. y = y0 + 0.5 * dy - for i in range(subpixels): + for _i in range(subpixels): # Characterize the polygon boundary on the horizontal line # at ``y``. Sloped and vertical edges that straddle the line # each contribute one crossing point (``xint_buf``), using @@ -453,7 +453,7 @@ cdef double polygon_overlap_single_subpixel(double x0, double y0, # x-span lies on that edge. x = x0 + 0.5 * dx ptr = 0 - for j in range(subpixels): + for _j in range(subpixels): while ptr < m and xint_buf[ptr] < x: ptr += 1 inside = (((m - ptr) & 1) == 1 diff --git a/regions/_geometry/rectangle_overlap.pyx b/regions/_geometry/rectangle_overlap.pyx index 1522e089..e9c588ff 100644 --- a/regions/_geometry/rectangle_overlap.pyx +++ b/regions/_geometry/rectangle_overlap.pyx @@ -198,17 +198,17 @@ cdef double rectangle_overlap_single_subpixel(double x0, double y0, Return the fraction of overlap between a rectangle and a single pixel with given extent, using a sub-pixel sampling method. """ - cdef unsigned int i, j + cdef unsigned int _i, _j cdef double x, y, x_tr, y_tr cdef double frac = 0.0 cdef double dx = (x1 - x0) / subpixels cdef double dy = (y1 - y0) / subpixels x = x0 - 0.5 * dx - for i in range(subpixels): + for _i in range(subpixels): x += dx y = y0 - 0.5 * dy - for j in range(subpixels): + for _j in range(subpixels): y += dy x_tr = y * sin_theta + x * cos_theta y_tr = y * cos_theta - x * sin_theta