From e1ccca947a297deb90301acc14b1e13e8dd0b816 Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Tue, 18 Jul 2017 00:20:25 +0100 Subject: BUG: Keep mask when calling methods on 0d arrays. This also prevents `.squeeze()` from ever returning `masked`, which was incorrect Fixes gh-9430. --- doc/release/1.14.0-notes.rst | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'doc') diff --git a/doc/release/1.14.0-notes.rst b/doc/release/1.14.0-notes.rst index b5d133081..0ba2edd96 100644 --- a/doc/release/1.14.0-notes.rst +++ b/doc/release/1.14.0-notes.rst @@ -94,6 +94,14 @@ This is for pytest compatibility in the case of duplicate test file names in the different directories. As a result, ``run_module_suite`` no longer works, i.e., ``python `` results in an error. +``MaskedArray.squeeze`` never returns ``np.ma.masked`` +------------------------------------------------------ +``np.squeeze`` is documented as returning a view, but the masked variant would +sometimes return ``masked``, which is not a view. This has been fixed, so that +the result is always a view on the original masked array. +This breaks any code that used ``masked_arr.squeeze() is np.ma.masked``, but +fixes code that writes to the result of `.squeeze()`. + C API changes ============= -- cgit v1.2.1