def test_check_distance_buffers_all_good(self): """Ensures correct output from _check_distance_buffers. In this case the set of distance buffers is valid. """ min_distances_metres = numpy.array([ SMALL_BUFFER_MIN_DISTANCE_METRES, MEDIUM_BUFFER_MIN_DISTANCE_METRES, LARGE_BUFFER_MIN_DISTANCE_METRES ]) max_distances_metres = numpy.array([ SMALL_BUFFER_MAX_DISTANCE_METRES, MEDIUM_BUFFER_MAX_DISTANCE_METRES, LARGE_BUFFER_MAX_DISTANCE_METRES ]) gridded_forecasts._check_distance_buffers(min_distances_metres, max_distances_metres)
def test_check_distance_buffers_non_unique(self): """Ensures correct output from _check_distance_buffers. In this case, distance buffers are non-unique. """ min_distances_metres = numpy.array([ SMALL_BUFFER_MIN_DISTANCE_METRES, SMALL_BUFFER_MIN_DISTANCE_METRES, MEDIUM_BUFFER_MIN_DISTANCE_METRES, LARGE_BUFFER_MIN_DISTANCE_METRES ]) max_distances_metres = numpy.array([ SMALL_BUFFER_MAX_DISTANCE_METRES, SMALL_BUFFER_MAX_DISTANCE_METRES, MEDIUM_BUFFER_MAX_DISTANCE_METRES, LARGE_BUFFER_MAX_DISTANCE_METRES ]) with self.assertRaises(ValueError): gridded_forecasts._check_distance_buffers(min_distances_metres, max_distances_metres)