Added unit test to catch a corner case where add_boundary_regions left some pores unlabeled
@@ -169,6 +169,17 @@ class NetExtractTest():
assert_allclose(actual=porosity_actual, desired=porosity_desired,
rtol=0.05)
+ def test_verify_no_unlabeled_regions(self):
+ np.random.seed(0)
+ alias = {1: "void", 2: "solid"}
+ boundary_faces = ["bottom", "top", "left", "right", "front", "back"]
+ im = ps.generators.blobs([100, 100, 100]) + 1
+ temp = ps.networks.snow_n(im=im, alias=alias, boundary_faces=boundary_faces)
+ proj = op.io.PoreSpy.import_data(temp)
+ net = proj.network
+ Ps = net.pores(["void", "solid"] + boundary_faces)
+ assert Ps.size == net.Np
+
if __name__ == '__main__':
t = NetExtractTest()
