diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2015-11-12 09:52:39 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2015-11-12 09:52:39 -0700 |
commit | 4be9ce7bea3321af3c9896da98c751f03459fa38 (patch) | |
tree | 4a4271a98c32aaeca1d68ff7cf6146492500037c /numpy/ma/core.py | |
parent | 76a75953e35b2916dfd88eaadf748c3333d0afd7 (diff) | |
parent | 628d55c08f753ea8714d29a453587f901e5bcb80 (diff) | |
download | numpy-4be9ce7bea3321af3c9896da98c751f03459fa38.tar.gz |
Merge pull request #6668 from charris/fix-make_mask
BUG: ma.make_mask should always return nomask for nomask argument.
Diffstat (limited to 'numpy/ma/core.py')
-rw-r--r-- | numpy/ma/core.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py index 87082d139..b9f7da092 100644 --- a/numpy/ma/core.py +++ b/numpy/ma/core.py @@ -1495,9 +1495,10 @@ def make_mask(m, copy=False, shrink=True, dtype=MaskType): shrink : bool, optional Whether to shrink `m` to ``nomask`` if all its values are False. dtype : dtype, optional - Data-type of the output mask. By default, the output mask has - a dtype of MaskType (bool). If the dtype is flexible, each field - has a boolean dtype. + Data-type of the output mask. By default, the output mask has a + dtype of MaskType (bool). If the dtype is flexible, each field has + a boolean dtype. This is ignored when `m` is ``nomask``, in which + case ``nomask`` is always returned. Returns ------- @@ -1547,7 +1548,7 @@ def make_mask(m, copy=False, shrink=True, dtype=MaskType): dtype=[('man', '|b1'), ('mouse', '|b1')]) """ - if m is nomask and shrink: + if m is nomask: return nomask elif isinstance(m, ndarray): # We won't return after this point to make sure we can shrink the mask |