From a43e292704931a76c1f173119cf7b64a734cb1f7 Mon Sep 17 00:00:00 2001 From: Malte Nyhuis <nyhuis@tfd.uni-hannover.de> Date: Thu, 17 Nov 2022 19:08:54 +0100 Subject: [PATCH] fix tests for unitvector computations --- tests/math/test_ntrfc_vectorcalc.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/math/test_ntrfc_vectorcalc.py b/tests/math/test_ntrfc_vectorcalc.py index b939b1a8..82320739 100644 --- a/tests/math/test_ntrfc_vectorcalc.py +++ b/tests/math/test_ntrfc_vectorcalc.py @@ -1,7 +1,5 @@ import numpy as np -from ntrfc.math.vectorcalc import unitvec_list - def test_absVec(): import numpy as np @@ -90,15 +88,20 @@ def test_vecAbs_list(): def test_unitvec_list(): + from ntrfc.math.vectorcalc import unitvec_list a = np.array([1,0,0]) b = np.array([0,0,9]) c = np.stack([a,b]) directions = unitvec_list(c) - assert directions[0] == np.array([1,0,0]) - assert directions[1] == np.array([0,0,1]) + assert all(np.equal(directions[0],np.array([1,0,0]))) + assert all(np.equal(directions[1],np.array([0,0,1]))) def test_unitvec(): + from ntrfc.math.vectorcalc import unitvec a = np.array([9,0,0]) am = unitvec(a) + assert all(np.equal(am,np.array([1,0,0]))) b = np.array([0,0,-9]) + bm = unitvec(b) + assert all(np.equal(bm,np.array([0,0,-1]))) -- GitLab