Skip to content
Merged
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
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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]
Expand All @@ -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/'
Expand Down
6 changes: 3 additions & 3 deletions regions/_geometry/circle_overlap.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions regions/_geometry/ellipse_overlap.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions regions/_geometry/polygon_overlap.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions regions/_geometry/rectangle_overlap.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading