Skip to content

Commit

Permalink
Merge branch 'develop' into pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
  • Loading branch information
cleder authored Nov 13, 2023
2 parents 70f3b08 + 45fdd8c commit 7fac462
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 3 additions & 6 deletions pygeoif/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,9 @@ def signed_area(coords: LineType) -> float:
xs, ys = map(list, zip(*(coord[:2] for coord in coords)))
xs.append(xs[1]) # pragma: no mutate
ys.append(ys[1]) # pragma: no mutate
return (
sum(
xs[i] * (ys[i + 1] - ys[i - 1]) # type: ignore [operator]
for i in range(1, len(coords))
)
/ 2.0
return cast(
float,
sum(xs[i] * (ys[i + 1] - ys[i - 1]) for i in range(1, len(coords))) / 2.0,
)


Expand Down
4 changes: 1 addition & 3 deletions pygeoif/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -955,9 +955,7 @@ def __init__(self, polygons: Sequence[PolygonType], unique: bool = False) -> Non
tuple(
Polygon(
shell=polygon[0],
holes=polygon[1] # type: ignore [misc]
if len(polygon) == 2 # noqa: PLR2004
else None,
holes=polygon[1] if len(polygon) == 2 else None, # noqa: PLR2004
)
for polygon in polygons
),
Expand Down

0 comments on commit 7fac462

Please sign in to comment.