Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions lib/iris/tests/test_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,10 @@ def setUp(self):
file = tests.get_data_path(('PP', 'aPProt1', 'rotatedMHtimecube.pp'))
cubes = iris.load(file)
self.cube = cubes[0]
self.cube_fill_val = self.cube.fill_value
self.assertCML(self.cube, ('analysis', 'original.cml'))

def _common(self, name, aggregate, original_name='original_common.cml', *args, **kwargs):
self.cube.data = self.cube.data.astype(np.float64)
self.cube.fill_value = self.cube_fill_val

self.assertCML(self.cube, ('analysis', original_name))

Expand All @@ -236,7 +234,6 @@ def test_std_dev(self):
def test_hmean(self):
# harmonic mean requires data > 0
self.cube.data *= self.cube.data
self.cube.fill_value = self.cube_fill_val
self._common('hmean', iris.analysis.HMEAN, 'original_hmean.cml', rtol=1e-05)

def test_gmean(self):
Expand Down
12 changes: 0 additions & 12 deletions lib/iris/tests/test_basic_maths.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,7 @@ def test_type_error(self):
class TestDivideAndMultiply(tests.IrisTest):
def setUp(self):
self.cube = iris.tests.stock.global_pp()
# We require to preserve the cube fill_value
# across the cube data setter operation.
fill_value = self.cube.fill_value
self.cube.data = self.cube.data - 260
self.cube.fill_value = fill_value

def test_divide(self):
a = self.cube
Expand Down Expand Up @@ -498,26 +494,18 @@ def test_multiplication_not_in_place(self):
class TestExponentiate(tests.IrisTest):
def setUp(self):
self.cube = iris.tests.stock.global_pp()
# We require to preserve the cube fill_value
# across the cube data setter operation.
self.fill_value = self.cube.fill_value
self.cube.data = self.cube.data - 260
self.cube.fill_value = self.fill_value

def test_exponentiate(self):
a = self.cube
a.data = a.data.astype(np.float64)
# We require to preserve the cube fill_value after setting the data.
a.fill_value = self.fill_value
e = pow(a, 4)
self.assertCMLApproxData(e, ('analysis', 'exponentiate.cml'))

def test_square_root(self):
# Make sure we have something which we can take the root of.
a = self.cube
a.data = abs(a.data)
# We require to preserve the cube fill_value after setting the data.
a.fill_value = self.fill_value
a.units **= 2

e = a ** 0.5
Expand Down