(self)
| 2787 | assert_array_equal([], meshgrid(*args, copy=False)) |
| 2788 | |
| 2789 | def test_indexing(self): |
| 2790 | x = [1, 2, 3] |
| 2791 | y = [4, 5, 6, 7] |
| 2792 | [X, Y] = meshgrid(x, y, indexing='ij') |
| 2793 | assert_array_equal(X, np.array([[1, 1, 1, 1], |
| 2794 | [2, 2, 2, 2], |
| 2795 | [3, 3, 3, 3]])) |
| 2796 | assert_array_equal(Y, np.array([[4, 5, 6, 7], |
| 2797 | [4, 5, 6, 7], |
| 2798 | [4, 5, 6, 7]])) |
| 2799 | |
| 2800 | # Test expected shapes: |
| 2801 | z = [8, 9] |
| 2802 | assert_(meshgrid(x, y)[0].shape == (4, 3)) |
| 2803 | assert_(meshgrid(x, y, indexing='ij')[0].shape == (3, 4)) |
| 2804 | assert_(meshgrid(x, y, z)[0].shape == (4, 3, 2)) |
| 2805 | assert_(meshgrid(x, y, z, indexing='ij')[0].shape == (3, 4, 2)) |
| 2806 | |
| 2807 | assert_raises(ValueError, meshgrid, x, y, indexing='notvalid') |
| 2808 | |
| 2809 | def test_sparse(self): |
| 2810 | [X, Y] = meshgrid([1, 2, 3], [4, 5, 6, 7], sparse=True) |
nothing calls this directly
no test coverage detected