pylint in tests
@@ -130,7 +130,8 @@ class TestDataComputations(unittest.TestCase):
self.assertEqual(avg.shape, (5,))
def test_average_by(self):
- avg, descriptor, n_obs = rsd.average_dataset_by(self.test_data, 'conds')
+ avg, descriptor, n_obs = rsd.average_dataset_by(
+ self.test_data, 'conds')
self.assertEqual(avg.shape, (6, 5))
self.assertEqual(len(descriptor), 6)
self.assertEqual(descriptor[-1], 5)
@@ -206,6 +207,7 @@ class TestSave(unittest.TestCase):
== chn_des['rois'])
assert data_loaded.descriptors['subj'] == 0
+
class TestMerge(unittest.TestCase):
def setUp(self):
measurements = np.random.rand(4, 10)
@@ -234,6 +236,7 @@ class TestMerge(unittest.TestCase):
self.test_data_merged.channel_descriptors['rois'],
self.test_data.channel_descriptors['rois'])
+
class TestOESplit(unittest.TestCase):
def setUp(self):
measurements = np.random.rand(4, 10)
@@ -243,25 +246,28 @@ class TestOESplit(unittest.TestCase):
self.full_data = rsd.Dataset(
measurements=measurements,
descriptors=des,
- obs_descriptors={'conds': np.array([str(i) for i in range(1,5)])},
+ obs_descriptors={
+ 'conds': np.array([str(i) for i in range(1, 5)])},
channel_descriptors=chn_des
)
self.odd_data = rsd.Dataset(
measurements=measurements[0::2],
descriptors=des,
- obs_descriptors={'conds': np.array([str(i) for i in range(1,5,2)])},
+ obs_descriptors={
+ 'conds': np.array([str(i) for i in range(1, 5, 2)])},
channel_descriptors=chn_des
)
self.even_data = rsd.Dataset(
measurements=measurements[1::2],
descriptors=des,
- obs_descriptors={'conds': np.array([str(i) for i in range(2,5,2)])},
+ obs_descriptors={
+ 'conds': np.array([str(i) for i in range(2, 5, 2)])},
channel_descriptors=chn_des
)
def test_odd_even_split(self):
- self.odd_split, self.even_split = self.full_data.odd_even_split('conds')
-
+ self.odd_split, self.even_split = \
+ self.full_data.odd_even_split('conds')
np.testing.assert_array_equal(
self.odd_data.measurements,
self.odd_split.measurements)
@@ -285,6 +291,7 @@ class TestOESplit(unittest.TestCase):
self.even_data.channel_descriptors['rois'],
self.even_split.channel_descriptors['rois'])
+
class TestNestedOESplit(unittest.TestCase):
def setUp(self):
measurements = np.random.rand(16, 10)
@@ -321,7 +328,6 @@ class TestNestedOESplit(unittest.TestCase):
'conds', 'runs')
self.odd_split.sort_by('runs')
self.even_split.sort_by('runs')
-
np.testing.assert_array_equal(
self.odd_data.measurements,
self.odd_split.measurements)
@@ -345,5 +351,6 @@ class TestNestedOESplit(unittest.TestCase):
self.even_data.channel_descriptors['rois'],
self.even_split.channel_descriptors['rois'])
+
if __name__ == '__main__':
unittest.main()
