コード例 #1
0
 def test_invalid_method(self):
     """Test attempt to extract neighbours found with a method that is not
     available within the neighbour cube. Raises an exception."""
     plugin = SpotExtraction(neighbour_selection_method="furthest")
     msg = 'The requested neighbour_selection_method "furthest" is not'
     with self.assertRaisesRegex(ValueError, msg):
         plugin.extract_coordinates(self.neighbour_cube)
コード例 #2
0
 def test_nearest_land(self):
     """Test extraction of nearest land neighbour x and y indices."""
     plugin = SpotExtraction(neighbour_selection_method="nearest_land")
     expected = self.neighbours[1, 0:2, :].astype(int)
     result = plugin.extract_coordinates(self.neighbour_cube)
     self.assertArrayEqual(result.data, expected)