Add test for prune_branches to up the coverage, the test is not really meaningful though
-import porespy as ps
import pytest
import numpy as np
-import scipy.ndimage as spim
from edt import edt
+import porespy as ps
+import scipy.ndimage as spim
from skimage.morphology import disk, ball
@@ -343,6 +343,11 @@ class FilterTest():
b = ps.filters.fftmorphology(im, strel=s, mode='erosion')
assert np.all(a == b)
+ def test_prune_branches(self):
+ im = ps.generators.blobs(shape=[50, 50, 50], porosity=0.5, blobiness=1)
+ im_pruned = ps.filters.prune_branches(im)
+ assert im_pruned.sum() == 62583
+
if __name__ == '__main__':
t = FilterTest()
