From ec23ab8b6105c1b79f045c499394967ecdf4bc22 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 24 Sep 2020 21:06:26 +0200 Subject: [PATCH] basic test for seeding --- python/tests/test_seeds.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 python/tests/test_seeds.py diff --git a/python/tests/test_seeds.py b/python/tests/test_seeds.py new file mode 100644 index 000000000..57631ccba --- /dev/null +++ b/python/tests/test_seeds.py @@ -0,0 +1,23 @@ +import pytest +import numpy as np +from scipy.spatial import cKDTree + +from damask import seeds + +class TestSeeds: + + @pytest.mark.parametrize('grid',[None,np.ones(3,dtype='i')*10]) + def test_from_random(self,grid): + N_seeds = np.random.randint(30,300) + size = np.ones(3) + np.random.random(3) + coords = seeds.from_random(size,N_seeds,grid) + assert (0<=coords).all() and (coords=distance