def test_nan_xy_to_Luv_uv(self): """ Tests :func:`colour.models.cie_luv.xy_to_Luv_uv` definition nan support. """ cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan] cases = set(permutations(cases * 3, r=2)) for case in cases: xy = np.array(case) xy_to_Luv_uv(xy)
def test_nan_xy_to_Luv_uv(self): """ Tests :func:`colour.models.cie_luv.xy_to_Luv_uv` definition nan support. """ cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan] cases = set(permutations(cases * 3, r=2)) for case in cases: xy = np.array(case) xy_to_Luv_uv(xy)
def uv_to_ij(uv: NDArray) -> NDArray: """ Convert given *uv* chromaticity coordinates to *ij* chromaticity coordinates. """ return xy_to_Luv_uv(UCS_uv_to_xy(uv))
def test_n_dimensional_xy_to_Luv_uv(self): """ Tests :func:`colour.models.cie_luv.xy_to_Luv_uv` definition n-dimensional arrays support. """ xy = np.array([0.54369558, 0.32107944]) uv = xy_to_Luv_uv(xy) xy = np.tile(xy, (6, 1)) uv = np.tile(uv, (6, 1)) np.testing.assert_almost_equal(xy_to_Luv_uv(xy), uv, decimal=7) xy = np.reshape(xy, (2, 3, 2)) uv = np.reshape(uv, (2, 3, 2)) np.testing.assert_almost_equal(xy_to_Luv_uv(xy), uv, decimal=7)
def test_n_dimensional_xy_to_Luv_uv(self): """ Tests :func:`colour.models.cie_luv.xy_to_Luv_uv` definition n-dimensional arrays support. """ xy = np.array([0.54369558, 0.32107944]) uv = xy_to_Luv_uv(xy) xy = np.tile(xy, (6, 1)) uv = np.tile(uv, (6, 1)) np.testing.assert_almost_equal(xy_to_Luv_uv(xy), uv, decimal=7) xy = np.reshape(xy, (2, 3, 2)) uv = np.reshape(uv, (2, 3, 2)) np.testing.assert_almost_equal(xy_to_Luv_uv(xy), uv, decimal=7)
def xy_to_ij(xy): """ Converts given *xy* chromaticity coordinates to *ij* chromaticity coordinates. """ return xy_to_Luv_uv(xy)
def xy_to_ij(xy): """ Converts given *xy* chromaticity coordinates to *ij* chromaticity coordinates. """ return xy_to_Luv_uv(xy)
def test_xy_to_Luv_uv(self): """ Tests :func:`colour.models.cie_luv.xy_to_Luv_uv` definition. """ np.testing.assert_almost_equal( xy_to_Luv_uv(np.array([0.54369558, 0.32107944])), np.array([0.37720213, 0.50120264]), decimal=7) np.testing.assert_almost_equal( xy_to_Luv_uv(np.array([0.29777734, 0.48246445])), np.array([0.14536327, 0.52992069]), decimal=7) np.testing.assert_almost_equal( xy_to_Luv_uv(np.array([0.18582824, 0.14633764])), np.array([0.16953603, 0.30039234]), decimal=7)
def test_xy_to_Luv_uv(self): """ Tests :func:`colour.models.cie_luv.xy_to_Luv_uv` definition. """ np.testing.assert_almost_equal(xy_to_Luv_uv( np.array([0.54369558, 0.32107944])), np.array([0.37720213, 0.50120264]), decimal=7) np.testing.assert_almost_equal(xy_to_Luv_uv( np.array([0.29777734, 0.48246445])), np.array([0.14536327, 0.52992069]), decimal=7) np.testing.assert_almost_equal(xy_to_Luv_uv( np.array([0.18582824, 0.14633764])), np.array([0.16953603, 0.30039234]), decimal=7)