Skip to content

Commit ea34f2c

Browse files
committed
run black and ruff
1 parent 5ff4aaa commit ea34f2c

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

geojson_pydantic/features.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Config:
3131
def check_bbox(cls, bbox: BBox) -> BBox:
3232
"""Check that bbox is valid."""
3333
if bbox is None:
34-
return bbox
34+
return bbox
3535
if len(bbox) == 6:
3636
if bbox[0] > bbox[3] or bbox[1] > bbox[4] or bbox[2] > bbox[5]: # type: ignore
3737
raise ValueError(

geojson_pydantic/geometries.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def __wkt_coordinates__(self, coordinates: Any, force_z: bool) -> str:
185185
@validator("coordinates")
186186
def check_closure(cls, coordinates: List) -> List:
187187
"""Validate that Polygon is closed (first and last coordinate are the same)."""
188-
if any([ring[-1] != ring[0] for ring in coordinates]):
188+
if any(ring[-1] != ring[0] for ring in coordinates):
189189
raise ValueError("All linear rings have the same start and end coordinates")
190190

191191
return coordinates
@@ -238,7 +238,7 @@ def has_z(self) -> bool:
238238
@validator("coordinates")
239239
def check_closure(cls, coordinates: List) -> List:
240240
"""Validate that Polygon is closed (first and last coordinate are the same)."""
241-
if any([ring[-1] != ring[0] for polygon in coordinates for ring in polygon]):
241+
if any(ring[-1] != ring[0] for polygon in coordinates for ring in polygon):
242242
raise ValueError("All linear rings have the same start and end coordinates")
243243

244244
return coordinates

tests/test_features.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,22 @@ def test_feature_validation():
231231
# missing geometry
232232
Feature(type="Feature", properties=None)
233233

234-
assert Feature(type="Feature", properties=None, bbox=[0, 0, 100, 100], geometry=None)
235-
assert Feature(type="Feature", properties=None, bbox=[0, 0, 0, 100, 100, 100], geometry=None)
234+
assert Feature(
235+
type="Feature", properties=None, bbox=[0, 0, 100, 100], geometry=None
236+
)
237+
assert Feature(
238+
type="Feature", properties=None, bbox=[0, 0, 0, 100, 100, 100], geometry=None
239+
)
236240

237241
with pytest.raises(ValidationError):
238242
# bad bbox2d
239243
Feature(type="Feature", properties=None, bbox=[100, 100, 0, 0], geometry=None)
240244

241245
with pytest.raises(ValidationError):
242246
# bad bbox3d
243-
Feature(type="Feature", properties=None, bbox=[100, 100, 100, 0, 0, 0], geometry=None)
247+
Feature(
248+
type="Feature",
249+
properties=None,
250+
bbox=[100, 100, 100, 0, 0, 0],
251+
geometry=None,
252+
)

0 commit comments

Comments
 (0)