summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
diff options
context:
space:
mode:
authorPer A. Brodtkorb <per.andreas.brodtkorb@gmail.com>2011-12-13 23:01:22 +0100
committerRalf Gommers <ralf.gommers@googlemail.com>2011-12-13 23:03:53 +0100
commite37a90c8bd1bf99f89b537ce47492095d6ae147c (patch)
tree591c79b9c0016233498daacd98d742dd078ac15c /numpy/lib/tests
parent5a683949d87fbad1dc93fb4fcb8b8293e7d19dc4 (diff)
downloadnumpy-e37a90c8bd1bf99f89b537ce47492095d6ae147c.tar.gz
ENH: enhance meshgrid to generate 3D grids, sparse grids, matrix indexing.
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r--numpy/lib/tests/test_function_base.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
index ba6b336ff..af85be326 100644
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -1025,6 +1025,24 @@ class TestMeshgrid(TestCase):
[5, 5, 5],
[6, 6, 6],
[7, 7, 7]])))
+ def test_indexing(self):
+ [X, Y] = meshgrid([1, 2, 3], [4, 5, 6, 7], indexing='ij')
+ assert_(all(X == array([[1, 1, 1, 1],
+ [2, 2, 2, 2],
+ [3, 3, 3, 3]])))
+ assert_(all(Y == array([[4, 5, 6, 7],
+ [4, 5, 6, 7],
+ [4, 5, 6, 7]])))
+
+ def test_sparse(self):
+ [X, Y] = meshgrid([1, 2, 3], [4, 5, 6, 7], sparse=True)
+ assert_(all(X == array([[1, 2, 3]])))
+ assert_(all(Y == array([[4],
+ [5],
+ [6],
+ [7]])))
+
+
class TestPiecewise(TestCase):