From 00dff152bb10c810176c7e47ad41e563df602208 Mon Sep 17 00:00:00 2001 From: Mark Wiebe Date: Tue, 2 Aug 2011 17:06:20 -0500 Subject: ENH: umath: Make sum, prod, any, or functions use the .reduce method directly This required some extensive changes, like: * Making logical_or, logical_and, and logical_not on object arrays behave like their Python equivalents instead of calling methods on the objects * Changing the units for a fair number of the binary operations to None, so they don't get initialized to their unit values at the start A consequence of this is that multi-dimensional reductions like sum, prod, any, or all no longer need to make copies, so are faster in some cases. --- numpy/lib/tests/test_function_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/lib/tests') diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index 105389d6d..0b6b1e19d 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -452,7 +452,7 @@ class TestTrapz(TestCase): def test_simple(self): r = trapz(exp(-1.0 / 2 * (arange(-10, 10, .1)) ** 2) / sqrt(2 * pi), dx=0.1) #check integral of normal equals 1 - assert_almost_equal(sum(r, axis=0), 1, 7) + assert_almost_equal(r, 1, 7) def test_ndim(self): x = linspace(0, 1, 3) -- cgit v1.2.1