(self)
| 2530 | assert_array_equal([], meshgrid(*args, copy=False)) |
| 2531 | |
| 2532 | def test_indexing(self): |
| 2533 | x = [1, 2, 3] |
| 2534 | y = [4, 5, 6, 7] |
| 2535 | [X, Y] = meshgrid(x, y, indexing='ij') |
| 2536 | assert_array_equal(X, np.array([[1, 1, 1, 1], |
| 2537 | [2, 2, 2, 2], |
| 2538 | [3, 3, 3, 3]])) |
| 2539 | assert_array_equal(Y, np.array([[4, 5, 6, 7], |
| 2540 | [4, 5, 6, 7], |
| 2541 | [4, 5, 6, 7]])) |
| 2542 | |
| 2543 | # Test expected shapes: |
| 2544 | z = [8, 9] |
| 2545 | assert_(meshgrid(x, y)[0].shape == (4, 3)) |
| 2546 | assert_(meshgrid(x, y, indexing='ij')[0].shape == (3, 4)) |
| 2547 | assert_(meshgrid(x, y, z)[0].shape == (4, 3, 2)) |
| 2548 | assert_(meshgrid(x, y, z, indexing='ij')[0].shape == (3, 4, 2)) |
| 2549 | |
| 2550 | assert_raises(ValueError, meshgrid, x, y, indexing='notvalid') |
| 2551 | |
| 2552 | def test_sparse(self): |
| 2553 | [X, Y] = meshgrid([1, 2, 3], [4, 5, 6, 7], sparse=True) |
nothing calls this directly
no test coverage detected