From 58229b8851fac4195250e57ce01e06a78f1fe909 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 2 Oct 2020 13:26:11 +0200 Subject: [PATCH] relaxed test conditions even threshold between -.5 and +.5 can result in a single material. --- python/tests/test_Geom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/tests/test_Geom.py b/python/tests/test_Geom.py index 884ae72e7..c2e476f8f 100644 --- a/python/tests/test_Geom.py +++ b/python/tests/test_Geom.py @@ -378,11 +378,11 @@ class TestGeom: def test_minimal_surface_basic_properties(self,surface): grid = np.random.randint(60,100,3) size = np.ones(3)+np.random.rand(3) - threshold = np.random.rand()-.5 + threshold = 2*np.random.rand()-1. periods = np.random.randint(2)+1 materials = np.random.randint(0,40,2) geom = Geom.from_minimal_surface(grid,size,surface,threshold,periods,materials) - assert geom.material.max() == materials.max() and geom.material.min() == materials.min() \ + assert set(geom.material.flatten()) | set(materials) == set(materials) \ and (geom.size == size).all() and (geom.grid == grid).all() @pytest.mark.parametrize('surface,threshold',[('Schwarz P',0),