Skip to content

Commit

Permalink
Remove skip from test_Data_flip to validate flip migration
Browse files Browse the repository at this point in the history
  • Loading branch information
sadielbartholomew committed Feb 23, 2022
1 parent d9995fe commit 2671c96
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions cf/test/test_Data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1794,7 +1794,6 @@ def test_Data_datum(self):
self.assertIs(d.datum([0, -1]), cf.masked)
self.assertIs(d.datum(-1, -1), cf.masked)

@unittest.skipIf(TEST_DASKIFIED_ONLY, "TypeError: 'int' is not iterable")
def test_Data_flip(self):
if self.test_only and inspect.stack()[0][3] not in self.test_only:
return
Expand All @@ -1816,26 +1815,22 @@ def test_Data_flip(self):
self.assertTrue((d.array == array).all())

array = np.arange(3 * 4 * 5).reshape(3, 4, 5) + 1
d = cf.Data(array.copy(), "metre", chunk=False)
d.chunk(total=[0], omit_axes=[1, 2])
d = cf.Data(array.copy(), "metre", chunks=-1)

self.assertEqual(d._pmshape, (3,))
self.assertEqual(d[0].shape, (1, 4, 5))
self.assertEqual(d[-1].shape, (1, 4, 5))
self.assertEqual(d[0].maximum(), 4 * 5)
self.assertEqual(d[-1].maximum(), 3 * 4 * 5)

for i in (2, 1):
e = d.flip(i)
self.assertEqual(e._pmshape, (3,))
self.assertEqual(e[0].shape, (1, 4, 5))
self.assertEqual(e[-1].shape, (1, 4, 5))
self.assertEqual(e[0].maximum(), 4 * 5)
self.assertEqual(e[-1].maximum(), 3 * 4 * 5)

i = 0
e = d.flip(i)
self.assertEqual(e._pmshape, (3,))
self.assertEqual(e[0].shape, (1, 4, 5))
self.assertEqual(e[-1].shape, (1, 4, 5))
self.assertEqual(e[0].maximum(), 3 * 4 * 5)
Expand Down

0 comments on commit 2671c96

Please sign in to comment.