Exemplo n.º 1
0
 def test_central_point_not_available(self):
     """Test that the central point is not available within the
        input cube."""
     forecast_period = 2
     plugin = TriangularWeightedBlendAcrossAdjacentPoints(
         "forecast_period", forecast_period, "hours", self.width)
     msg = "The central point 2 in units of hours"
     with self.assertRaisesRegex(ValueError, msg):
         plugin._find_central_point(self.cube)
Exemplo n.º 2
0
 def test_central_point_not_available(self):
     """Test that the central point is not available within the
        input cube."""
     forecast_period = 2
     plugin = TriangularWeightedBlendAcrossAdjacentPoints(
         'forecast_period', forecast_period, 'hours', self.width,
         'weighted_mean')
     msg = 'The central point of'
     with self.assertRaisesRegex(ValueError, msg):
         plugin._find_central_point(self.cube)
 def test_central_point_available(self):
     """Test that the central point is available within the input cube."""
     plugin = TriangularWeightedBlendAcrossAdjacentPoints(
         'forecast_period', self.forecast_period, 'hours', self.width)
     central_cube = plugin._find_central_point(self.cube)
     self.assertEqual(self.central_cube.coord('forecast_period'),
                      central_cube.coord('forecast_period'))
     self.assertEqual(self.central_cube.coord('time'),
                      central_cube.coord('time'))
     self.assertArrayEqual(self.central_cube.data, central_cube.data)