Commit 9ec496f9 authored by Martin Reinecke's avatar Martin Reinecke

Merge branch 'any_all_for_MultiFields' into 'NIFTy_4'

added any() and all() methods to MultiField

See merge request ift/NIFTy!275
parents dfbc582a 3b887359
Pipeline #38008 passed with stages
in 2 minutes and 2 seconds
......@@ -160,6 +160,18 @@ class MultiField(object):
return False
return True
def any(self):
for field in self._val.values():
if field.any():
return True
return False
def all(self):
for field in self._val.values():
if not field.all():
return False
return True
for op in ["__add__", "__radd__", "__iadd__",
"__sub__", "__rsub__", "__isub__",
"__mul__", "__rmul__", "__imul__",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment