Skip to content

Commit

Permalink
fix private import to work across scikit-image versions
Browse files Browse the repository at this point in the history
  • Loading branch information
grlee77 committed Dec 16, 2024
1 parent c2d4b97 commit 6c08a42
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions python/cucim/src/cucim/skimage/morphology/_skeletonize.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,17 @@ def medial_axis(image, mask=None, return_distance=False, *, rng=None):
"""
try:
from skimage.morphology._skeletonize_cy import _skeletonize_loop
except ImportError as e:
warnings.warn(
"Could not find required private skimage Cython function:\n"
"\tskimage.morphology._skeletonize_cy._skeletonize_loop\n"
)
raise e
except ImportError:
try:
from skimage.morphology._skeletonize_various_cy import (
_skeletonize_loop,
) # noqa: E501
except ImportError as e:
warnings.warn(
"Could not find required private skimage Cython function:\n"
"\tskimage.morphology._skeletonize_cy._skeletonize_loop\n"
)
raise e

if mask is None:
# masked_image is modified in-place later so make a copy of the input
Expand Down

0 comments on commit 6c08a42

Please sign in to comment.