From d932fcd38d9ef0f76c988d6c197856fa0c71314b Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Mon, 13 Feb 2017 21:02:06 +0000 Subject: BUG: Copy meshgrid after broadcasting, fixing #8561 Also, remove some unused variables --- numpy/lib/tests/test_function_base.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'numpy/lib/tests/test_function_base.py') diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index 5c2446e50..f69c24d59 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -2266,6 +2266,16 @@ class TestMeshgrid(TestCase): assert_(X.dtype == x.dtype) assert_(Y.dtype == y.dtype) + def test_writeback(self): + # Issue 8561 + X = np.array([1.1, 2.2]) + Y = np.array([3.3, 4.4]) + x, y = np.meshgrid(X, Y, sparse=False, copy=True) + + x[0, :] = 0 + assert_equal(x[0, :], 0) + assert_equal(x[1, :], X) + class TestPiecewise(TestCase): -- cgit v1.2.1