def test_evaluate_grad_cross_cov_respect_point(self):
        value = self.gp.evaluate_grad_cross_cov_respect_point(np.array([[40.0]]),
                                                              np.array([[39.0], [38.0]]),
                                                              np.array([1.0, 1.0]))

        value_2 = ScaledKernel.evaluate_grad_respect_point(np.array([1.0, 1.0]),
                                                           np.array([[40.0]]),
                                                           np.array([[39.0], [38.0]]), 1,
                                                           *([MATERN52_NAME],))

        assert np.all(value == value_2)


        type_kernel = [MATERN52_NAME]
        training_data = {
            "evaluations":
                [42.2851784656, 72.3121248508, 1.0113231069, 30.9309246906, 15.5288331909],
            "points": [
                [42.2851784656], [72.3121248508], [1.0113231069], [30.9309246906], [15.5288331909]],
            "var_noise": []}
        dimensions = [1]

        gp = GPFittingGaussian(type_kernel, training_data, dimensions)
        value = gp.evaluate_grad_cross_cov_respect_point(np.array([[40.0]]),
                                                         np.array([[39.0], [38.0]]),
                                                         np.array([1.0]))

        value_2 = Matern52.evaluate_grad_respect_point(np.array([1.0]),
                                                       np.array([[40.0]]),
                                                       np.array([[39.0], [38.0]]), 1)

        assert np.all(value == value_2)
    def test_evaluate_grad_respect_point(self):
        result = Matern52.evaluate_grad_respect_point(np.array([5.0]),
                                                      np.array([[1]]),
                                                      np.array([[4], [5]]), 1)

        kernel = Matern52.define_kernel_from_array(1, np.array([5.0]))
        assert np.all(result == kernel.grad_respect_point(
            np.array([[1]]), np.array([[4], [5]])))