def test_basic(self): """Test it fills in the points it's meant to.""" plugin = FallingSnowLevel() plugin.fill_in_sea_points(self.snow_falling_level, self.land_sea, self.max_wb_integral, self.wet_bulb_temperature, self.heights) self.assertArrayAlmostEqual(self.snow_falling_level.data, self.expected_snow_falling_level)
def test_no_sea(self): """Test it only fills in sea points, and ignores a land point""" plugin = FallingSnowLevel() expected = np.ones((3, 3)) * np.nan land_sea = np.ones((3, 3)) plugin.fill_in_sea_points(self.snow_falling_level, land_sea, self.max_wb_integral, self.wet_bulb_temperature, self.heights) self.assertArrayAlmostEqual(self.snow_falling_level.data, expected)
def test_all_above_threshold(self): """Test it doesn't change points that are all above the threshold""" plugin = FallingSnowLevel() self.max_wb_integral[0, 1] = 100 self.snow_falling_level[0, 1] = 100 self.expected_snow_falling_level[0, 1] = 100 plugin.fill_in_sea_points(self.snow_falling_level, self.land_sea, self.max_wb_integral, self.wet_bulb_temperature, self.heights) self.assertArrayAlmostEqual(self.snow_falling_level.data, self.expected_snow_falling_level)