Skip to content

Commit 37958af

Browse files
committed
added image from runner
1 parent 905fa46 commit 37958af

File tree

3 files changed

+2
-19
lines changed

3 files changed

+2
-19
lines changed

src/spatialdata_plot/pl/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1253,7 +1253,7 @@ def _validate_polygons(shapes: GeoDataFrame) -> GeoDataFrame:
12531253
Parameters
12541254
----------
12551255
shapes
1256-
GeoDataFrame containing a ``geometry`` column.
1256+
GeoDataFrame containing a `geometry` column.
12571257
12581258
Returns
12591259
-------
7.33 KB
Loading

tests/pl/test_utils.py

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
import geopandas as gpd
21
import matplotlib
32
import matplotlib.pyplot as plt
43
import numpy as np
54
import pandas as pd
65
import pytest
76
import scanpy as sc
8-
from shapely.geometry import Polygon
97
from spatialdata import SpatialData
108

119
import spatialdata_plot
12-
from spatialdata_plot.pl.utils import _get_subplots, _validate_polygons
10+
from spatialdata_plot.pl.utils import _get_subplots
1311
from tests.conftest import DPI, PlotTester, PlotTesterMeta
1412

1513
sc.pl.set_rcParams_defaults()
@@ -138,18 +136,3 @@ def test_utils_get_subplots_produces_correct_axs_layout(input_output):
138136

139137
assert len_axs == len(axs.flatten())
140138
assert axs_visible == [ax.axison for ax in axs.flatten()]
141-
142-
143-
def test_validate_polygons_converts_holed_polygons(caplog):
144-
shell = [(0.0, 0.0), (0.0, 1.0), (1.0, 1.0), (1.0, 0.0), (0.0, 0.0)]
145-
hole = [(0.2, 0.2), (0.2, 0.8), (0.8, 0.8), (0.8, 0.2), (0.2, 0.2)]
146-
holed_polygon = Polygon(shell, [hole])
147-
plain_polygon = Polygon([(2.0, 0.0), (2.0, 1.0), (3.0, 1.0), (3.0, 0.0), (2.0, 0.0)])
148-
shapes = gpd.GeoDataFrame({"geometry": [holed_polygon, plain_polygon]})
149-
150-
with caplog.at_level("INFO"):
151-
validated = _validate_polygons(shapes.copy())
152-
153-
assert validated.iloc[0].geometry.geom_type == "MultiPolygon"
154-
assert validated.iloc[1].geometry.geom_type == "Polygon"
155-
assert "Converted 1 Polygon" in caplog.text

0 commit comments

Comments
 (0)