Skip to content

Commit cb2918b

Browse files
committed
ENH: Explicit fast_cross_3d test
1 parent 58c0e72 commit cb2918b

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

surfer/tests/test_utils.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from os.path import join as pjoin
22

33
import numpy as np
4-
from numpy.testing import assert_array_almost_equal
4+
from numpy.testing import assert_array_almost_equal, assert_array_equal
55

66
from surfer import utils
77

@@ -51,6 +51,16 @@ def test_surface():
5151
assert_array_almost_equal(x + 2, x_)
5252

5353
# normals
54-
nn = _slow_compute_normals(surface.coords, surface.faces[:100])
55-
nn_fast = utils._compute_normals(surface.coords, surface.faces[:100])
54+
nn = _slow_compute_normals(surface.coords, surface.faces[:10000])
55+
nn_fast = utils._compute_normals(surface.coords, surface.faces[:10000])
5656
assert_array_almost_equal(nn, nn_fast)
57+
58+
59+
def test_huge_cross():
60+
"""Test cross product with lots of elements
61+
"""
62+
x = np.random.rand(100000, 3)
63+
y = np.random.rand(1, 3)
64+
z = np.cross(x, y)
65+
zz = utils._fast_cross_3d(x, y)
66+
assert_array_equal(z, zz)

0 commit comments

Comments
 (0)