Esempio n. 1
0
    def test_kernel_nearest(self):
        """
        Tests :func:`colour.algebra.interpolation.kernel_nearest_neighbour`
        definition.
        """

        np.testing.assert_almost_equal(
            kernel_nearest_neighbour(np.linspace(-5, 5, 25)),
            np.array([
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0
            ]),
            decimal=7)
    def test_kernel_nearest(self):
        """
        Tests :func:`colour.algebra.interpolation.kernel_nearest_neighbour`
        definition.
        """

        np.testing.assert_almost_equal(
            kernel_nearest_neighbour(np.linspace(-5, 5, 25)),
            np.array([
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0
            ]),
            decimal=7)