Пример #1
0
 def test_returned(self):
     lazy_data, weights = SUM.lazy_aggregate(
         self.cube_2d.lazy_data(), axis=0, returned=True
     )
     self.assertTrue(is_lazy_data(lazy_data))
     self.assertArrayEqual(lazy_data.compute(), [7, 9, 11, 13, 15])
     self.assertArrayEqual(weights, [2, 2, 2, 2, 2])
Пример #2
0
 def test_lazy_ma(self):
     lazy_data = SUM.lazy_aggregate(self.cube.lazy_data(), axis=0)
     self.assertTrue(is_lazy_data(lazy_data))
     self.assertArrayEqual(lazy_data.compute(), [12])
Пример #3
0
 def test_lazy_collapse(self):
     lazy_data = SUM.lazy_aggregate(self.lazy_cube.lazy_data(), axis=0)
     self.assertArrayEqual(lazy_data.compute(), [15])
Пример #4
0
 def test_lazy(self):
     lazy_data = SUM.lazy_aggregate(self.lazy_cube.lazy_data(), axis=0)
     self.assertTrue(is_lazy_data(lazy_data))
Пример #5
0
 def test_weights(self):
     lazy_data = SUM.lazy_aggregate(
         self.cube_2d.lazy_data(), axis=0, weights=self.weights
     )
     self.assertTrue(is_lazy_data(lazy_data))
     self.assertArrayEqual(lazy_data.compute(), [14, 9, 11, 13, 15])