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)
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)
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)
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)
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 )