Skip to content

Commit 2bc6eb9

Browse files
committed
Ruff format tests
1 parent 7f7622a commit 2bc6eb9

File tree

1 file changed

+17
-27
lines changed

1 file changed

+17
-27
lines changed

tests/test_spatial/test_polygon_generator.py

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -515,13 +515,15 @@ def test_clamp_longitude_with_out_of_bounds_coordinates(self):
515515
FIX: clamp_longitude clamps all coordinates to [-180, 180] range.
516516
"""
517517
# Create polygon with out-of-bounds longitude coordinates
518-
polygon = Polygon([
519-
(180.5, 85.0), # Over max
520-
(-180.8, 86.0), # Under min
521-
(179.0, 87.0), # Valid
522-
(-179.0, 86.5), # Valid
523-
(180.5, 85.0) # Closing point
524-
])
518+
polygon = Polygon(
519+
[
520+
(180.5, 85.0), # Over max
521+
(-180.8, 86.0), # Under min
522+
(179.0, 87.0), # Valid
523+
(-179.0, 86.5), # Valid
524+
(180.5, 85.0), # Closing point
525+
]
526+
)
525527

526528
clamped = clamp_longitude(polygon)
527529

@@ -535,19 +537,15 @@ def test_clamp_longitude_with_out_of_bounds_coordinates(self):
535537
# Verify specific clamping
536538
assert coords[0][0] == 180.0 # 180.5 -> 180.0
537539
assert coords[1][0] == -180.0 # -180.8 -> -180.0
538-
assert coords[2][0] == 179.0 # unchanged
540+
assert coords[2][0] == 179.0 # unchanged
539541
assert coords[3][0] == -179.0 # unchanged
540542

541543
def test_clamp_longitude_with_valid_coordinates(self):
542544
"""Test that clamp_longitude doesn't modify already valid coordinates."""
543545
# Create polygon with all valid coordinates
544-
polygon = Polygon([
545-
(179.0, 85.0),
546-
(-179.0, 86.0),
547-
(0.0, 87.0),
548-
(90.0, 86.5),
549-
(179.0, 85.0)
550-
])
546+
polygon = Polygon(
547+
[(179.0, 85.0), (-179.0, 86.0), (0.0, 87.0), (90.0, 86.5), (179.0, 85.0)]
548+
)
551549

552550
clamped = clamp_longitude(polygon)
553551

@@ -559,12 +557,9 @@ def test_clamp_longitude_with_valid_coordinates(self):
559557

560558
def test_clamp_longitude_preserves_latitude(self):
561559
"""Test that clamp_longitude only modifies longitude, not latitude."""
562-
polygon = Polygon([
563-
(180.5, 85.123),
564-
(-180.8, 86.456),
565-
(179.0, 87.789),
566-
(180.5, 85.123)
567-
])
560+
polygon = Polygon(
561+
[(180.5, 85.123), (-180.8, 86.456), (179.0, 87.789), (180.5, 85.123)]
562+
)
568563

569564
clamped = clamp_longitude(polygon)
570565
coords = list(clamped.exterior.coords)
@@ -576,12 +571,7 @@ def test_clamp_longitude_preserves_latitude(self):
576571

577572
def test_clamp_longitude_returns_valid_polygon(self):
578573
"""Test that clamp_longitude returns a valid Shapely polygon."""
579-
polygon = Polygon([
580-
(180.9, 85.0),
581-
(-180.9, 86.0),
582-
(0.0, 87.0),
583-
(180.9, 85.0)
584-
])
574+
polygon = Polygon([(180.9, 85.0), (-180.9, 86.0), (0.0, 87.0), (180.9, 85.0)])
585575

586576
clamped = clamp_longitude(polygon)
587577

0 commit comments

Comments
 (0)