def test_unmatched_validity_time_exemption(self): """Test that no ValueError is raised for unmatched validity times if we use the timeblending=True flag. As long as no exception is raised this test passes.""" self.cube.remove_coord("time") self.cube.coord("forecast_reference_time").rename("time") plugin = WeightedBlendAcrossWholeDimension(self.coord, timeblending=True) plugin.check_compatible_time_points(self.cube)
def test_unmatched_validity_time_exception(self): """Test that a ValueError is raised if the validity time of the slices over the blending coordinate differ. We should only be blending data at equivalent times unless we are triangular time blending.""" self.cube.remove_coord("time") self.cube.coord("forecast_reference_time").rename("time") coord = "forecast_reference_time" plugin = WeightedBlendAcrossWholeDimension(coord) msg = "Attempting to blend data for different validity times." with self.assertRaisesRegex(ValueError, msg): plugin.check_compatible_time_points(self.cube)
def test_basic(self): """Test that no errors are raised when calling check_compatible_time_point""" coord = "time" plugin = WeightedBlendAcrossWholeDimension(coord) plugin.check_compatible_time_points(self.cube)