Example #1
0
 def test_spot(self):
     """Test providing spot historic forecasts and truths."""
     check_data_sufficiency(
         self.historic_forecast_spot_cube,
         self.truth_spot_cube,
         self.point_by_point,
         self.proportion_of_nans,
     )
Example #2
0
 def test_gridded(self):
     """Test providing gridded historic forecasts and truths."""
     check_data_sufficiency(
         self.historic_temperature_forecast_cube,
         self.temperature_truth_cube,
         self.point_by_point,
         self.proportion_of_nans,
     )
Example #3
0
 def test_spot_point_by_point(self):
     """Test providing spot historic forecasts and truths when using
     point-by-point processing."""
     point_by_point = True
     check_data_sufficiency(
         self.historic_forecast_spot_cube,
         self.truth_spot_cube,
         point_by_point,
         self.proportion_of_nans,
     )
Example #4
0
 def test_spot_nans(self):
     """Test providing spot historic forecasts and truths with
     a proportion of NaNs above the allowable proportion."""
     msg = (
         "The proportion of NaNs detected is 0.7. This is higher than "
         "the allowable proportion of NaNs within the historic forecasts "
         "and truth pairs: 0.5."
     )
     with self.assertRaisesRegex(ValueError, msg):
         check_data_sufficiency(
             self.hf_with_nans,
             self.truth_with_nans,
             self.point_by_point,
             self.proportion_of_nans,
         )
Example #5
0
 def test_spot_point_by_point_nans(self):
     """Test providing spot historic forecasts and truths when using
     point-by-point processing with a proportion of NaNs above the
     allowable proportion."""
     point_by_point = True
     msg = (
         "3 sites have a proportion of NaNs that is higher than the "
         "allowable proportion of NaNs within the historic forecasts "
         "and truth pairs. The allowable proportion is 0.5. "
         "The maximum proportion of NaNs is 1.0."
     )
     with self.assertRaisesRegex(ValueError, msg):
         check_data_sufficiency(
             self.hf_with_nans,
             self.truth_with_nans,
             point_by_point,
             self.proportion_of_nans,
         )