add test to ensure image is exactly the same each time
@@ -313,6 +313,13 @@ class GeneratorTest():
assert (im1.sum() > im2.sum())
assert im2.sum() > 0
+ def test_pseudo_electrostatic_packing_vals(self):
+ np.random.seed(0)
+ im = ps.generators.blobs(shape=[100, 100])
+ im = ps.generators.pseudo_electrostatic_packing(
+ im=im, r=3, clearance=1, protrusion=1)
+ np.testing.assert_allclose(np.linalg.norm(im), 46.2276, rtol=1e-5)
+
if __name__ == '__main__':
t = GeneratorTest()
