summaryrefslogtreecommitdiff
path: root/numpy/ma
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2018-09-17 09:08:42 +0300
committerEric Wieser <wieser.eric@gmail.com>2018-09-16 23:08:42 -0700
commit73d7871970a951edd48e5c40bdc7609385ce61e6 (patch)
tree7e71e96faf55f1d716417c5f057323152d97bbe6 /numpy/ma
parentf49c0169f5a62d4bfa62c791e2a4e2b78ddf7517 (diff)
downloadnumpy-73d7871970a951edd48e5c40bdc7609385ce61e6.tar.gz
MAINT: refactor design of recursive closures (#11910)
Diffstat (limited to 'numpy/ma')
-rw-r--r--numpy/ma/core.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index 65ce967ae..a6c3e64d6 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -46,6 +46,7 @@ from numpy.compat import (
from numpy import expand_dims
from numpy.core.multiarray import normalize_axis_index
from numpy.core.numeric import normalize_axis_tuple
+from numpy.core._internal import recursive
if sys.version_info[0] >= 3:
@@ -1729,12 +1730,13 @@ def mask_or(m1, m2, copy=False, shrink=True):
"""
- def _recursive_mask_or(m1, m2, newmask):
+ @recursive
+ def _recursive_mask_or(self, m1, m2, newmask):
names = m1.dtype.names
for name in names:
current1 = m1[name]
if current1.dtype.names is not None:
- _recursive_mask_or(current1, m2[name], newmask[name])
+ self(current1, m2[name], newmask[name])
else:
umath.logical_or(current1, m2[name], newmask[name])
return