예제 #1
0
    def test_kernel(self):
        """
        Tests :func:`colour.algebra.interpolation.KernelInterpolator.kernel`
        property.
        """

        x = y = np.linspace(0, 1, 10)
        kernel_interpolator = KernelInterpolator(x, y, kernel=kernel_linear)

        self.assertIs(kernel_interpolator.kernel, kernel_linear)
예제 #2
0
    def test_window(self):
        """
        Tests :func:`colour.algebra.interpolation.KernelInterpolator.window`
        property.
        """

        x = y = np.linspace(0, 1, 10)
        kernel_interpolator = KernelInterpolator(x, y, window=3)

        self.assertEqual(kernel_interpolator.window, 3)
예제 #3
0
    def test_y(self):
        """
        Tests :func:`colour.algebra.interpolation.KernelInterpolator.y`
        property.
        """

        x = y = np.linspace(0, 1, 10)
        kernel_interpolator = KernelInterpolator(x, y)

        np.testing.assert_equal(kernel_interpolator.y, y)
예제 #4
0
    def test_x(self):
        """
        Test :attr:`colour.algebra.interpolation.KernelInterpolator.x`
        property.
        """

        x = y = np.linspace(0, 1, 10)
        kernel_interpolator = KernelInterpolator(x, y)

        np.testing.assert_equal(kernel_interpolator.x, x)
예제 #5
0
    def test_padding_kwargs(self):
        """
        Test :attr:`colour.algebra.interpolation.KernelInterpolator.\
padding_kwargs` property.
        """

        x = y = np.linspace(0, 1, 10)
        padding_kwargs = {"pad_width": (3, 3), "mode": "mean"}
        kernel_interpolator = KernelInterpolator(
            x, y, padding_kwargs=padding_kwargs
        )

        self.assertDictEqual(
            kernel_interpolator.padding_kwargs, padding_kwargs
        )