Commit 198e4750 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

disable min() and max() for Fields and data objects

parent fee7b4d2
...@@ -158,11 +158,11 @@ class data_object(object): ...@@ -158,11 +158,11 @@ class data_object(object):
def prod(self, axis=None): def prod(self, axis=None):
return self._contraction_helper("prod", MPI.PROD, axis) return self._contraction_helper("prod", MPI.PROD, axis)
def min(self, axis=None): # def min(self, axis=None):
return self._contraction_helper("min", MPI.MIN, axis) # return self._contraction_helper("min", MPI.MIN, axis)
def max(self, axis=None): # def max(self, axis=None):
return self._contraction_helper("max", MPI.MAX, axis) # return self._contraction_helper("max", MPI.MAX, axis)
def mean(self, axis=None): def mean(self, axis=None):
if axis is None: if axis is None:
......
...@@ -481,39 +481,39 @@ class Field(object): ...@@ -481,39 +481,39 @@ class Field(object):
def any(self, spaces=None): def any(self, spaces=None):
return self._contraction_helper('any', spaces) return self._contraction_helper('any', spaces)
def min(self, spaces=None): # def min(self, spaces=None):
"""Determines the minimum over the sub-domains given by `spaces`. # """Determines the minimum over the sub-domains given by `spaces`.
#
Parameters # Parameters
---------- # ----------
spaces : None, int or tuple of int (default: None) # spaces : None, int or tuple of int (default: None)
The operation is only carried out over the sub-domains in this # The operation is only carried out over the sub-domains in this
tuple. If None, it is carried out over all sub-domains. # tuple. If None, it is carried out over all sub-domains.
#
Returns # Returns
------- # -------
Field or scalar # Field or scalar
The result of the operation. If it is carried out over the entire # The result of the operation. If it is carried out over the entire
domain, this is a scalar, otherwise a Field. # domain, this is a scalar, otherwise a Field.
""" # """
return self._contraction_helper('min', spaces) # return self._contraction_helper('min', spaces)
#
def max(self, spaces=None): # def max(self, spaces=None):
"""Determines the maximum over the sub-domains given by `spaces`. # """Determines the maximum over the sub-domains given by `spaces`.
#
Parameters # Parameters
---------- # ----------
spaces : None, int or tuple of int (default: None) # spaces : None, int or tuple of int (default: None)
The operation is only carried out over the sub-domains in this # The operation is only carried out over the sub-domains in this
tuple. If None, it is carried out over all sub-domains. # tuple. If None, it is carried out over all sub-domains.
#
Returns # Returns
------- # -------
Field or scalar # Field or scalar
The result of the operation. If it is carried out over the entire # The result of the operation. If it is carried out over the entire
domain, this is a scalar, otherwise a Field. # domain, this is a scalar, otherwise a Field.
""" # """
return self._contraction_helper('max', spaces) # return self._contraction_helper('max', spaces)
def mean(self, spaces=None): def mean(self, spaces=None):
"""Determines the mean over the sub-domains given by `spaces`. """Determines the mean over the sub-domains given by `spaces`.
......
...@@ -154,8 +154,8 @@ class Test_Functionality(unittest.TestCase): ...@@ -154,8 +154,8 @@ class Test_Functionality(unittest.TestCase):
assert_equal(f1.local_data, +f1.local_data) assert_equal(f1.local_data, +f1.local_data)
assert_equal(f1.sum(), f1.sum(0)) assert_equal(f1.sum(), f1.sum(0))
f1 = ift.from_global_data(s1, np.arange(10)) f1 = ift.from_global_data(s1, np.arange(10))
assert_equal(f1.min(), 0) # assert_equal(f1.min(), 0)
assert_equal(f1.max(), 9) # assert_equal(f1.max(), 9)
assert_equal(f1.prod(), 0) assert_equal(f1.prod(), 0)
def test_weight(self): def test_weight(self):
......
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