From 36f04309b4bbd906f6c57108b920329566ec8e6a Mon Sep 17 00:00:00 2001 From: Samad Vakili Date: Tue, 9 Jun 2020 21:33:13 +0200 Subject: [PATCH] issue in test_mechanics --- python/tests/test_mechanics.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/tests/test_mechanics.py b/python/tests/test_mechanics.py index 10a36fbcc..9708d4ee8 100644 --- a/python/tests/test_mechanics.py +++ b/python/tests/test_mechanics.py @@ -150,8 +150,8 @@ class TestMechanics: def test_vectorize_2_arg(self,vectorized,single): P = np.random.rand(self.n,3,3) F = np.random.rand(self.n,3,3) - P_vec = np.random.rand(self.n//10,10,3,3) - F_vec = np.random.rand(self.n//10,10,3,3) + P_vec = np.reshape(P,(self.n//10,10,3,3)) + F_vec = np.reshape(F,(self.n//10,10,3,3)) for i,v in enumerate(np.reshape(vectorized(P_vec,F_vec),vectorized(P,F).shape)): assert np.allclose(single(P[i],F[i]),v) @@ -159,7 +159,7 @@ class TestMechanics: @pytest.mark.parametrize('vectorized,single',[(mechanics.strain_tensor,strain_tensor)]) def test_vectorize_strain_tensor(self,vectorized,single): F = np.random.rand(self.n,3,3) - F_vec = np.random.rand(self.n//10,10,3,3) + F_vec = np.reshape(F,(self.n//10,10,3,3)) t = ['V','U'][np.random.randint(0,2)] m = np.random.random()*10.0 -5.0 for i,v in enumerate(np.reshape(vectorized(F_vec,t,m),vectorized(F,t,m).shape)):