예제 #1
0
 def test_lazy(self):
     lazy_data = COUNT.lazy_aggregate(self.lazy_cube.lazy_data(),
                                      axis=0,
                                      function=self.func)
     self.assertTrue(is_lazy_data(lazy_data))
예제 #2
0
 def test_not_callable(self):
     with self.assertRaisesRegex(TypeError, 'function must be a callable'):
         COUNT.aggregate(self.cube.data, axis=0, function='wibble')
예제 #3
0
 def test_lazy_not_callable(self):
     with self.assertRaisesRegex(TypeError, 'function must be a callable'):
         COUNT.lazy_aggregate(self.lazy_cube.lazy_data(),
                              axis=0,
                              function='wibble')
예제 #4
0
 def test_name(self):
     self.assertEqual(COUNT.name(), 'count')
예제 #5
0
 def test_no_function(self):
     exp_emsg = r"function must be a callable. Got <.* 'NoneType'>"
     with self.assertRaisesRegex(TypeError, exp_emsg):
         COUNT.lazy_aggregate(self.lazy_cube.lazy_data(), axis=0)
예제 #6
0
 def test_ma(self):
     data = COUNT.aggregate(self.cube.data, axis=0, function=self.func)
     self.assertArrayEqual(data, [2])
예제 #7
0
파일: test_COUNT.py 프로젝트: SciTools/iris
 def test_no_function(self):
     exp_emsg = r"function must be a callable. Got <.* 'NoneType'>"
     with self.assertRaisesRegexp(TypeError, exp_emsg):
         COUNT.lazy_aggregate(self.lazy_cube.lazy_data(), axis=0)
예제 #8
0
파일: test_COUNT.py 프로젝트: cpelley/iris
 def test(self):
     self.assertIsNotNone(COUNT.units_func)
     new_units = COUNT.units_func(None)
     self.assertEqual(new_units, 1)
예제 #9
0
파일: test_COUNT.py 프로젝트: cpelley/iris
 def test(self):
     self.assertEqual(COUNT.name(), 'count')
예제 #10
0
파일: test_COUNT.py 프로젝트: SciTools/iris
 def test_lazy_collapse(self):
     lazy_data = COUNT.lazy_aggregate(self.lazy_cube.lazy_data(),
                                      axis=0,
                                      function=self.func)
     self.assertArrayEqual(lazy_data.compute(), [3])
예제 #11
0
파일: test_COUNT.py 프로젝트: SciTools/iris
 def test_ma(self):
     data = COUNT.aggregate(self.cube.data, axis=0, function=self.func)
     self.assertArrayEqual(data, [2])
예제 #12
0
파일: test_COUNT.py 프로젝트: SciTools/iris
 def test_lazy(self):
     lazy_data = COUNT.lazy_aggregate(self.lazy_cube.lazy_data(),
                                      axis=0,
                                      function=self.func)
     self.assertTrue(is_lazy_data(lazy_data))
예제 #13
0
파일: test_COUNT.py 프로젝트: SciTools/iris
 def test_lazy_not_callable(self):
     with self.assertRaisesRegexp(TypeError, 'function must be a callable'):
         COUNT.lazy_aggregate(self.lazy_cube.lazy_data(),
                              axis=0,
                              function='wibble')
예제 #14
0
파일: test_COUNT.py 프로젝트: SciTools/iris
 def test_not_callable(self):
     with self.assertRaisesRegexp(TypeError, 'function must be a callable'):
         COUNT.aggregate(self.cube.data, axis=0, function='wibble')
예제 #15
0
 def test_lazy_collapse(self):
     lazy_data = COUNT.lazy_aggregate(self.lazy_cube.lazy_data(),
                                      axis=0,
                                      function=self.func)
     self.assertArrayEqual(lazy_data.compute(), [3])
예제 #16
0
파일: test_COUNT.py 프로젝트: cpelley/iris
 def test(self):
     shape = ()
     kwargs = dict()
     self.assertTupleEqual(COUNT.aggregate_shape(**kwargs), shape)
     kwargs = dict(wibble='wobble')
     self.assertTupleEqual(COUNT.aggregate_shape(**kwargs), shape)
예제 #17
0
 def test(self):
     self.assertIsNotNone(COUNT.units_func)
     new_units = COUNT.units_func(None)
     self.assertEqual(new_units, 1)
예제 #18
0
 def test(self):
     shape = ()
     kwargs = dict()
     self.assertTupleEqual(COUNT.aggregate_shape(**kwargs), shape)
     kwargs = dict(wibble='wobble')
     self.assertTupleEqual(COUNT.aggregate_shape(**kwargs), shape)
예제 #19
0
 def test_ma(self):
     lazy_data = COUNT.lazy_aggregate(self.lazy_cube.lazy_data(),
                                      axis=0,
                                      function=self.func)
     self.assertTrue(is_lazy_data(lazy_data))
     self.assertArrayEqual(lazy_data.compute(), [2])
예제 #20
0
파일: test_COUNT.py 프로젝트: SciTools/iris
 def test_ma(self):
     lazy_data = COUNT.lazy_aggregate(self.lazy_cube.lazy_data(),
                                      axis=0,
                                      function=self.func)
     self.assertTrue(is_lazy_data(lazy_data))
     self.assertArrayEqual(lazy_data.compute(), [2])