summaryrefslogtreecommitdiff
path: root/numpy/ma/tests/test_extras.py
diff options
context:
space:
mode:
authorAlbert <albert.jornet@ic3.cat>2014-03-06 16:17:52 +0100
committerjurnix <albert.jornet@ic3.cat>2014-03-27 12:27:33 +0100
commitddc95d379f410c7ff787c157ded6c40bb873215c (patch)
tree89f67ab367c93beaa7887790a7c81b981da8e0ee /numpy/ma/tests/test_extras.py
parenta6f9b782cd9b60fc1464e6a4a7ef9a7762fcf2d5 (diff)
downloadnumpy-ddc95d379f410c7ff787c157ded6c40bb873215c.tar.gz
ENH: apply_along_axis accepts named arguments
Diffstat (limited to 'numpy/ma/tests/test_extras.py')
-rw-r--r--numpy/ma/tests/test_extras.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/numpy/ma/tests/test_extras.py b/numpy/ma/tests/test_extras.py
index dc0f87b92..98fb0597e 100644
--- a/numpy/ma/tests/test_extras.py
+++ b/numpy/ma/tests/test_extras.py
@@ -479,6 +479,16 @@ class TestApplyAlongAxis(TestCase):
xa = apply_along_axis(myfunc, 2, a)
assert_equal(xa, [[1, 4], [7, 10]])
+ # Tests kwargs functions
+ def test_3d_kwargs(self):
+ a = arange(12).reshape(2, 2, 3)
+
+ def myfunc(b, offset=0):
+ return b[1+offset]
+
+ xa = apply_along_axis(myfunc, 2, a, offset=1)
+ assert_equal(xa, [[2, 5], [8, 11]])
+
class TestApplyOverAxes(TestCase):
# Tests apply_over_axes