Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AnihilatorGun committed Nov 18, 2024
1 parent d9bc10b commit 567da9a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/test_convex_hull.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np
import pytest
from skimage import data
from skimage.morphology import convex_hull_image
from skimage.morphology.convex_hull import _offsets_diamond
Expand Down Expand Up @@ -60,13 +61,26 @@ def test_convex_hull_image(offset_coordinates):
assert not (chull < chull_ref).any()


def test_convex_hull_image_cornercases(offset_coordinates):
def test_convex_hull_image_non2d(offset_coordinates):
image = np.zeros((3, 3, 3), dtype=bool)

with pytest.raises(RuntimeError):
chull = convex_hull_image_fast(image, offset_coordinates=offset_coordinates)


def test_convex_hull_image_empty(offset_coordinates):
image = np.zeros((10, 10), dtype=bool)

with pytest.warns(UserWarning):
chull = convex_hull_image_fast(image, offset_coordinates=offset_coordinates)

assert (chull == np.zeros_like(chull)).all()


def test_convex_hull_image_qhullsrc_issues():
image = np.zeros((10, 10), dtype=bool)
image[1, 1] = True
image[-2, -2] = True

with pytest.warns(UserWarning):
chull = convex_hull_image_fast(image, offset_coordinates=offset_coordinates)
Expand Down

0 comments on commit 567da9a

Please sign in to comment.