Skip to content

Commit

Permalink
removed test of group-wise calc and replaced it with option 2 test
Browse files Browse the repository at this point in the history
  • Loading branch information
Duncan Campbell committed Jun 4, 2020
1 parent 010bc96 commit 4886d39
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions halotools/utils/tests/test_rotate_vector_collection.py
Expand Up @@ -13,7 +13,7 @@

def test_rotation_1():
"""
single rotation matrix + single set of points
test option 1: single rotation matrix + set of points
"""

# create a single rotation matrix
Expand All @@ -24,7 +24,7 @@ def test_rotation_1():
rot_m = rotation_matrices_from_vectors(v1,v2)
rot = rot_m[0]

# create a single set of vectors
# create a set of vectors
npts = 1000
ndim = 3
v3 = np.random.random((npts,ndim))
Expand All @@ -34,22 +34,20 @@ def test_rotation_1():
assert np.shape(v4)==(npts, ndim)


def test_rotation_3():
def test_rotation_2():
"""
nset of rotation matrices + nset of npts of points
test option 2: n rotation matrices + n points
"""

nsets = 2
npts = 1000
ndim = 3
v1 = np.random.random((nsets,ndim))
v2 = np.random.random((nsets,ndim))
v1 = np.random.random((npts,ndim))
v2 = np.random.random((npts,ndim))

rot = rotation_matrices_from_vectors(v1,v2)

npts = 1000
ndim = 3
v3 = np.random.random((nsets, npts, ndim))
v3 = np.random.random((npts, ndim))

v4 = rotate_vector_collection(rot, v3)

assert np.shape(v4)==(nsets, npts, ndim)
assert np.shape(v4)==(npts, ndim)

0 comments on commit 4886d39

Please sign in to comment.