def test_uniform_radial_kernel_bandwidth(self):
     """Test the bandwidth using the uniform radial kernel ."""
     distance = gs.array([[1 / 2], [2]], dtype=float)
     weight = uniform_radial_kernel(distance=distance, bandwidth=1 / 4)
     result = weight
     expected = gs.array([[0], [0]])
     self.assertAllClose(expected, result)
Esempio n. 2
0
 def test_check_bandwidth(self):
     """Test the function checking the bandwidth parameter."""
     distance = gs.array([[1 / 2], [2]], dtype=float)
     bandwidth = 0
     self.assertRaises(
         ValueError, lambda: uniform_radial_kernel(distance=distance,
                                                   bandwidth=bandwidth))
 def test_check_distance(self):
     """Test the function checking the distance parameter."""
     distance = gs.array([[1 / 2], [-2]], dtype=float)
     self.assertRaises(ValueError,
                       lambda: uniform_radial_kernel(distance=distance))