Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_warns_for_islands(self, four_square_grid):
with pytest.warns(IslandWarning):
adjacencies(four_square_grid.loc[[0, 3]])
if warn_for_overlaps:
overlaps = inters[inters.area > 0]
if len(overlaps) > 0:
warnings.warn(
"Found overlapping polygons while computing adjacencies.\n"
"This could be evidence of topological problems.\n"
"Indices of overlaps: {}".format(set(overlaps.index)),
OverlapWarning,
)
if warn_for_islands:
islands = set(geometries.index) - set(i for pair in inters.index for i in pair)
if len(islands) > 0:
warnings.warn(
"Found islands.\n" "Indices of islands: {}".format(islands),
IslandWarning,
)
return inters