diff --git a/pygeoif/functions.py b/pygeoif/functions.py index d9f5190d..19cd7b75 100644 --- a/pygeoif/functions.py +++ b/pygeoif/functions.py @@ -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, ) diff --git a/pygeoif/geometry.py b/pygeoif/geometry.py index 58ed051a..fdbe7164 100644 --- a/pygeoif/geometry.py +++ b/pygeoif/geometry.py @@ -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 ),