|
1 | | -import geopandas as gpd |
2 | 1 | import matplotlib |
3 | 2 | import matplotlib.pyplot as plt |
4 | 3 | import numpy as np |
5 | 4 | import pandas as pd |
6 | 5 | import pytest |
7 | 6 | import scanpy as sc |
8 | | -from shapely.geometry import Polygon |
9 | 7 | from spatialdata import SpatialData |
10 | 8 |
|
11 | 9 | import spatialdata_plot |
12 | | -from spatialdata_plot.pl.utils import _get_subplots, _validate_polygons |
| 10 | +from spatialdata_plot.pl.utils import _get_subplots |
13 | 11 | from tests.conftest import DPI, PlotTester, PlotTesterMeta |
14 | 12 |
|
15 | 13 | sc.pl.set_rcParams_defaults() |
@@ -138,18 +136,3 @@ def test_utils_get_subplots_produces_correct_axs_layout(input_output): |
138 | 136 |
|
139 | 137 | assert len_axs == len(axs.flatten()) |
140 | 138 | 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