Skip to content

Commit b1ee32f

Browse files
pjonssonomad
authored andcommitted
model: check for None
1 parent 3e80f25 commit b1ee32f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cubedash/summary/_model.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import warnings
22
from collections import Counter
3+
from collections.abc import Sequence
34
from dataclasses import dataclass
45
from datetime import date, datetime
56
from typing import Iterable
@@ -299,7 +300,7 @@ def _erase_elements_from(items: list, start_i: int) -> list:
299300

300301

301302
def _create_unified_footprint(
302-
with_valid_geometries: list["TimePeriodOverview"], footprint_tolerance: float
303+
with_valid_geometries: Sequence[TimePeriodOverview], footprint_tolerance: float
303304
) -> BaseGeometry | None:
304305
"""
305306
Union the given time period's footprints, trying to fix any invalid geometries.
@@ -319,7 +320,11 @@ def _create_unified_footprint(
319320
try:
320321
_LOG.warning("summary.footprint.invalid_union", exc_info=True)
321322
geometry_union = shapely.ops.unary_union(
322-
[p.footprint_geometry.buffer(0.001) for p in with_valid_geometries]
323+
[
324+
p.footprint_geometry.buffer(0.001)
325+
for p in with_valid_geometries
326+
if p.footprint_geometry is not None
327+
]
323328
)
324329
except ValueError:
325330
_LOG.warning("summary.footprint.invalid_buffered_union", exc_info=True)

0 commit comments

Comments
 (0)