From b074b21c326ecaa6b6519fc7dfcf54fa4e4457af Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Wed, 11 Mar 2020 10:53:27 -0700 Subject: ENH: Add `subok` parameter to np.copy function (cf. gfh6509) (gh-15685) This is largely a re-submission of the original change proposed in #6509. Discussion was hosted in multiple forums including #3474, the numpy mailing list circa 10-2015, and the 02-26-2020 NumPy Triage meeting. This PR closes #3474 and #15570 --- numpy/lib/tests/test_function_base.py | 7 +++++++ 1 file changed, 7 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 751a7a212..860cf452b 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -273,6 +273,13 @@ class TestCopy: assert_(not a_fort_copy.flags.c_contiguous) assert_(a_fort_copy.flags.f_contiguous) + def test_subok(self): + mx = ma.ones(5) + assert_(not ma.isMaskedArray(np.copy(mx, subok=False))) + assert_(ma.isMaskedArray(np.copy(mx, subok=True))) + # Default behavior + assert_(not ma.isMaskedArray(np.copy(mx))) + class TestAverage: -- cgit v1.2.1