code stringlengths 66 870k | docstring stringlengths 19 26.7k | func_name stringlengths 1 138 | language stringclasses 1
value | repo stringlengths 7 68 | path stringlengths 5 324 | url stringlengths 46 389 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
def K_coefficient(
xez_1: ArrayLike,
xez_2: ArrayLike,
bRGB_o1: ArrayLike,
bRGB_o2: ArrayLike,
Y_o: ArrayLike,
n: ArrayLike = 1,
) -> NDArrayFloat:
"""
Compute the coefficient :math:`K` for correcting the difference between
the test and references illuminances.
Parameters
--... |
Compute the coefficient :math:`K` for correcting the difference between
the test and references illuminances.
Parameters
----------
xez_1
Intermediate values :math:`\xi_1`, :math:`\eta_1`, :math:`\zeta_1`
for the test illuminant and background.
xez_2
Intermediate values... | K_coefficient | python | colour-science/colour | colour/adaptation/cie1994.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/cie1994.py | BSD-3-Clause |
def corresponding_colour(
RGB_1: ArrayLike,
xez_1: ArrayLike,
xez_2: ArrayLike,
bRGB_o1: ArrayLike,
bRGB_o2: ArrayLike,
Y_o: ArrayLike,
K: ArrayLike,
n: ArrayLike = 1,
) -> NDArrayFloat:
"""
Compute the corresponding colour cone responses of the specified test sample
cone res... |
Compute the corresponding colour cone responses of the specified test sample
cone responses :math:`RGB_1`.
Parameters
----------
RGB_1
Test sample cone responses :math:`RGB_1`.
xez_1
Intermediate values :math:`\xi_1`, :math:`\eta_1`, :math:`\zeta_1`
for the test illumin... | corresponding_colour | python | colour-science/colour | colour/adaptation/cie1994.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/cie1994.py | BSD-3-Clause |
def RGB_c(
x_1: NDArrayFloat,
x_2: NDArrayFloat,
y_1: NDArrayFloat,
y_2: NDArrayFloat,
z: NDArrayFloat,
n: NDArrayFloat,
) -> NDArrayFloat:
"""Compute the corresponding colour cone responses component."""
with sdiv_mode():
return (Y_o * x_... | Compute the corresponding colour cone responses component. | RGB_c | python | colour-science/colour | colour/adaptation/cie1994.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/cie1994.py | BSD-3-Clause |
def chromatic_adaptation_forward_CMCCAT2000(
XYZ: ArrayLike,
XYZ_w: ArrayLike,
XYZ_wr: ArrayLike,
L_A1: ArrayLike,
L_A2: ArrayLike,
surround: InductionFactors_CMCCAT2000 = VIEWING_CONDITIONS_CMCCAT2000["Average"],
) -> NDArrayFloat:
"""
Adapt the specified stimulus *CIE XYZ* tristimulus ... |
Adapt the specified stimulus *CIE XYZ* tristimulus values from test viewing
conditions to reference viewing conditions using *CMCCAT2000* forward
chromatic adaptation model.
Parameters
----------
XYZ
*CIE XYZ* tristimulus values of the stimulus to adapt.
XYZ_w
Test viewing ... | chromatic_adaptation_forward_CMCCAT2000 | python | colour-science/colour | colour/adaptation/cmccat2000.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/cmccat2000.py | BSD-3-Clause |
def chromatic_adaptation_inverse_CMCCAT2000(
XYZ_c: ArrayLike,
XYZ_w: ArrayLike,
XYZ_wr: ArrayLike,
L_A1: ArrayLike,
L_A2: ArrayLike,
surround: InductionFactors_CMCCAT2000 = VIEWING_CONDITIONS_CMCCAT2000["Average"],
) -> NDArrayFloat:
"""
Adapt the specified stimulus corresponding colour... |
Adapt the specified stimulus corresponding colour *CIE XYZ* tristimulus
values from reference viewing conditions to test viewing conditions using
*CMCCAT2000* inverse chromatic adaptation model.
Parameters
----------
XYZ_c
*CIE XYZ* tristimulus values of the stimulus to adapt.
XYZ_... | chromatic_adaptation_inverse_CMCCAT2000 | python | colour-science/colour | colour/adaptation/cmccat2000.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/cmccat2000.py | BSD-3-Clause |
def chromatic_adaptation_CMCCAT2000(
XYZ: ArrayLike,
XYZ_w: ArrayLike,
XYZ_wr: ArrayLike,
L_A1: ArrayLike,
L_A2: ArrayLike,
surround: InductionFactors_CMCCAT2000 = VIEWING_CONDITIONS_CMCCAT2000["Average"],
direction: Literal["Forward", "Inverse"] | str = "Forward",
) -> NDArrayFloat:
"""... |
Adapt the specified stimulus *CIE XYZ* tristimulus values using the specified
viewing conditions.
This definition is a convenient wrapper around
:func:`colour.adaptation.chromatic_adaptation_forward_CMCCAT2000` and
:func:`colour.adaptation.chromatic_adaptation_inverse_CMCCAT2000`.
Parameters
... | chromatic_adaptation_CMCCAT2000 | python | colour-science/colour | colour/adaptation/cmccat2000.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/cmccat2000.py | BSD-3-Clause |
def chromatic_adaptation_Fairchild1990(
XYZ_1: ArrayLike,
XYZ_n: ArrayLike,
XYZ_r: ArrayLike,
Y_n: ArrayLike,
discount_illuminant: bool = False,
) -> NDArrayFloat:
"""
Adapt the specified stimulus *CIE XYZ_1* tristimulus values from test viewing
conditions to reference viewing conditions... |
Adapt the specified stimulus *CIE XYZ_1* tristimulus values from test viewing
conditions to reference viewing conditions using *Fairchild (1990)*
chromatic adaptation model.
Parameters
----------
XYZ_1
*CIE XYZ_1* tristimulus values of test sample / stimulus.
XYZ_n
Test vie... | chromatic_adaptation_Fairchild1990 | python | colour-science/colour | colour/adaptation/fairchild1990.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/fairchild1990.py | BSD-3-Clause |
def degrees_of_adaptation(
LMS: ArrayLike,
Y_n: ArrayLike,
v: ArrayLike = 1 / 3,
discount_illuminant: bool = False,
) -> NDArrayFloat:
"""
Compute the degrees of adaptation :math:`p_L`, :math:`p_M` and
:math:`p_S`.
Parameters
----------
LMS
Cone responses.
Y_n
... |
Compute the degrees of adaptation :math:`p_L`, :math:`p_M` and
:math:`p_S`.
Parameters
----------
LMS
Cone responses.
Y_n
luminance :math:`Y_n` of test adapting stimulus in :math:`cd/m^2`.
v
Exponent :math:`v`.
discount_illuminant
Truth value indicating ... | degrees_of_adaptation | python | colour-science/colour | colour/adaptation/fairchild1990.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/fairchild1990.py | BSD-3-Clause |
def P_c(x: NDArrayFloat) -> NDArrayFloat:
"""Compute the :math:`P_L`, :math:`P_M` or :math:`P_S` terms."""
return sdiv(
1 + Ye_n[..., None] + x,
1 + Ye_n[..., None] + sdiv(1, x),
) | Compute the :math:`P_L`, :math:`P_M` or :math:`P_S` terms. | P_c | python | colour-science/colour | colour/adaptation/fairchild1990.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/fairchild1990.py | BSD-3-Clause |
def matrix_chromatic_adaptation_vk20(
XYZ_p: ArrayLike,
XYZ_n: ArrayLike,
XYZ_r: ArrayLike = TVS_XYZ_R_VK20,
transform: Literal[
"Bianco 2010",
"Bianco PC 2010",
"Bradford",
"CAT02 Brill 2008",
"CAT02",
"CAT16",
"CMCCAT2000",
"CMCCAT97",
... |
Compute the chromatic adaptation matrix from previous viewing conditions
to adapting viewing conditions using *Von Kries 2020* (*vK20*) method.
Parameters
----------
XYZ_p
Previous viewing conditions *CIE XYZ* tristimulus values of the
whitepoint.
XYZ_n
Adapting viewing... | matrix_chromatic_adaptation_vk20 | python | colour-science/colour | colour/adaptation/fairchild2020.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/fairchild2020.py | BSD-3-Clause |
def chromatic_adaptation_vK20(
XYZ: ArrayLike,
XYZ_p: ArrayLike,
XYZ_n: ArrayLike,
XYZ_r: ArrayLike = TVS_XYZ_R_VK20,
transform: Literal[
"Bianco 2010",
"Bianco PC 2010",
"Bradford",
"CAT02 Brill 2008",
"CAT02",
"CAT16",
"CMCCAT2000",
"... |
Adapt the specified stimulus from previous viewing conditions to adapting
viewing conditions using *Von Kries 2020* (*vK20*) method.
Parameters
----------
XYZ
*CIE XYZ* tristimulus values of the stimulus to adapt.
XYZ_p
Previous viewing conditions *CIE XYZ* tristimulus values o... | chromatic_adaptation_vK20 | python | colour-science/colour | colour/adaptation/fairchild2020.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/fairchild2020.py | BSD-3-Clause |
def matrix_chromatic_adaptation_VonKries(
XYZ_w: ArrayLike,
XYZ_wr: ArrayLike,
transform: LiteralChromaticAdaptationTransform | str = "CAT02",
) -> NDArrayFloat:
"""
Compute the chromatic adaptation matrix from test viewing conditions to
reference viewing conditions.
Parameters
--------... |
Compute the chromatic adaptation matrix from test viewing conditions to
reference viewing conditions.
Parameters
----------
XYZ_w
Test viewing conditions *CIE XYZ* tristimulus values of the
whitepoint.
XYZ_wr
Reference viewing conditions *CIE XYZ* tristimulus values of ... | matrix_chromatic_adaptation_VonKries | python | colour-science/colour | colour/adaptation/vonkries.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/vonkries.py | BSD-3-Clause |
def chromatic_adaptation_VonKries(
XYZ: ArrayLike,
XYZ_w: ArrayLike,
XYZ_wr: ArrayLike,
transform: LiteralChromaticAdaptationTransform | str = "CAT02",
) -> NDArrayFloat:
"""
Adapt the specified stimulus from test viewing conditions to reference
viewing conditions.
Parameters
------... |
Adapt the specified stimulus from test viewing conditions to reference
viewing conditions.
Parameters
----------
XYZ
*CIE XYZ* tristimulus values of the stimulus to adapt.
XYZ_w
Test viewing conditions *CIE XYZ* tristimulus values of the
whitepoint.
XYZ_wr
R... | chromatic_adaptation_VonKries | python | colour-science/colour | colour/adaptation/vonkries.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/vonkries.py | BSD-3-Clause |
def chromatic_adaptation_Zhai2018(
XYZ_b: ArrayLike,
XYZ_wb: ArrayLike,
XYZ_wd: ArrayLike,
D_b: ArrayLike = 1,
D_d: ArrayLike = 1,
XYZ_wo: ArrayLike = (1, 1, 1),
transform: Literal["CAT02", "CAT16"] | str = "CAT02",
) -> NDArrayFloat:
"""
Adapt the specified sample colour :math:`XYZ_... |
Adapt the specified sample colour :math:`XYZ_{\beta}` tristimulus values
from input viewing conditions under :math:`\beta` illuminant to output
viewing conditions under :math:`\delta` illuminant using
*Zhai and Luo (2018)* chromatic adaptation model.
According to the definition of :math:`D`, a one... | chromatic_adaptation_Zhai2018 | python | colour-science/colour | colour/adaptation/zhai2018.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/zhai2018.py | BSD-3-Clause |
def chromatic_adaptation(
XYZ: ArrayLike,
XYZ_w: ArrayLike,
XYZ_wr: ArrayLike,
method: (
Literal[
"CIE 1994",
"CMCCAT2000",
"Fairchild 1990",
"Von Kries",
"Zhai 2018",
"vK20",
]
| str
) = "Von Kries",
... |
Adapt the specified stimulus from test viewing conditions to reference viewing
conditions.
Parameters
----------
XYZ
*CIE XYZ* tristimulus values of stimulus to adapt.
XYZ_w
Test viewing condition *CIE XYZ* tristimulus values of the whitepoint.
XYZ_wr
Reference view... | chromatic_adaptation | python | colour-science/colour | colour/adaptation/__init__.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/__init__.py | BSD-3-Clause |
def test_n_dimensional_chromatic_adaptation_CIE1994(self) -> None:
"""
Test :func:`colour.adaptation.cie1994.chromatic_adaptation_CIE1994`
definition n-dimensional arrays support.
"""
XYZ_1 = np.array([28.00, 21.26, 5.27])
xy_o1 = np.array([0.44760, 0.40740])
xy_... |
Test :func:`colour.adaptation.cie1994.chromatic_adaptation_CIE1994`
definition n-dimensional arrays support.
| test_n_dimensional_chromatic_adaptation_CIE1994 | python | colour-science/colour | colour/adaptation/tests/test_cie1994.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_cie1994.py | BSD-3-Clause |
def test_domain_range_scale_chromatic_adaptation_CIE1994(self) -> None:
"""
Test :func:`colour.adaptation.cie1994.chromatic_adaptation_CIE1994`
definition domain and range scale support.
"""
XYZ_1 = np.array([28.00, 21.26, 5.27])
xy_o1 = np.array([0.44760, 0.40740])
... |
Test :func:`colour.adaptation.cie1994.chromatic_adaptation_CIE1994`
definition domain and range scale support.
| test_domain_range_scale_chromatic_adaptation_CIE1994 | python | colour-science/colour | colour/adaptation/tests/test_cie1994.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_cie1994.py | BSD-3-Clause |
def test_nan_chromatic_adaptation_CIE1994(self) -> None:
"""
Test :func:`colour.adaptation.cie1994.chromatic_adaptation_CIE1994`
definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
ch... |
Test :func:`colour.adaptation.cie1994.chromatic_adaptation_CIE1994`
definition nan support.
| test_nan_chromatic_adaptation_CIE1994 | python | colour-science/colour | colour/adaptation/tests/test_cie1994.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_cie1994.py | BSD-3-Clause |
def test_n_dimensional_chromatic_adaptation_forward_CMCCAT2000(self) -> None:
"""
Test :func:`colour.adaptation.cmccat2000.\
chromatic_adaptation_forward_CMCCAT2000` definition n-dimensional arrays
support.
"""
XYZ = np.array([22.48, 22.74, 8.54])
XYZ_w = np.array([111.1... |
Test :func:`colour.adaptation.cmccat2000.chromatic_adaptation_forward_CMCCAT2000` definition n-dimensional arrays
support.
| test_n_dimensional_chromatic_adaptation_forward_CMCCAT2000 | python | colour-science/colour | colour/adaptation/tests/test_cmccat2000.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_cmccat2000.py | BSD-3-Clause |
def test_domain_range_scale_chromatic_adaptation_CMCCAT2000(self) -> None:
"""
Test :func:`colour.adaptation.cmccat2000.\
chromatic_adaptation_forward_CMCCAT2000` definition domain and range scale
support.
"""
XYZ = np.array([22.48, 22.74, 8.54])
XYZ_w = np.array([111.15... |
Test :func:`colour.adaptation.cmccat2000.chromatic_adaptation_forward_CMCCAT2000` definition domain and range scale
support.
| test_domain_range_scale_chromatic_adaptation_CMCCAT2000 | python | colour-science/colour | colour/adaptation/tests/test_cmccat2000.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_cmccat2000.py | BSD-3-Clause |
def test_nan_chromatic_adaptation_forward_CMCCAT2000(self) -> None:
"""
Test :func:`colour.adaptation.cmccat2000.\
chromatic_adaptation_forward_CMCCAT2000` definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repe... |
Test :func:`colour.adaptation.cmccat2000.chromatic_adaptation_forward_CMCCAT2000` definition nan support.
| test_nan_chromatic_adaptation_forward_CMCCAT2000 | python | colour-science/colour | colour/adaptation/tests/test_cmccat2000.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_cmccat2000.py | BSD-3-Clause |
def test_n_dimensional_chromatic_adaptation_inverse_CMCCAT2000(self) -> None:
"""
Test :func:`colour.adaptation.cmccat2000.\
chromatic_adaptation_inverse_CMCCAT2000` definition n-dimensional arrays
support.
"""
XYZ_c = np.array([19.52698326, 23.06833960, 24.97175229])
XY... |
Test :func:`colour.adaptation.cmccat2000.chromatic_adaptation_inverse_CMCCAT2000` definition n-dimensional arrays
support.
| test_n_dimensional_chromatic_adaptation_inverse_CMCCAT2000 | python | colour-science/colour | colour/adaptation/tests/test_cmccat2000.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_cmccat2000.py | BSD-3-Clause |
def test_domain_range_scale_chromatic_adaptation_CMCCAT2000(self) -> None:
"""
Test :func:`colour.adaptation.cmccat2000.\
chromatic_adaptation_inverse_CMCCAT2000` definition domain and range scale
support.
"""
XYZ_c = np.array([19.52698326, 23.06833960, 24.97175229])
XYZ... |
Test :func:`colour.adaptation.cmccat2000.chromatic_adaptation_inverse_CMCCAT2000` definition domain and range scale
support.
| test_domain_range_scale_chromatic_adaptation_CMCCAT2000 | python | colour-science/colour | colour/adaptation/tests/test_cmccat2000.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_cmccat2000.py | BSD-3-Clause |
def test_nan_chromatic_adaptation_inverse_CMCCAT2000(self) -> None:
"""
Test :func:`colour.adaptation.cmccat2000.\
chromatic_adaptation_inverse_CMCCAT2000` definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repe... |
Test :func:`colour.adaptation.cmccat2000.chromatic_adaptation_inverse_CMCCAT2000` definition nan support.
| test_nan_chromatic_adaptation_inverse_CMCCAT2000 | python | colour-science/colour | colour/adaptation/tests/test_cmccat2000.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_cmccat2000.py | BSD-3-Clause |
def test_n_dimensional_chromatic_adaptation_Fairchild1990(self) -> None:
"""
Test :func:`colour.adaptation.fairchild1990.\
chromatic_adaptation_Fairchild1990` definition n-dimensional arrays support.
"""
XYZ_1 = np.array([19.53, 23.07, 24.97])
XYZ_n = np.array([111.15, 100.00, 3... |
Test :func:`colour.adaptation.fairchild1990.chromatic_adaptation_Fairchild1990` definition n-dimensional arrays support.
| test_n_dimensional_chromatic_adaptation_Fairchild1990 | python | colour-science/colour | colour/adaptation/tests/test_fairchild1990.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_fairchild1990.py | BSD-3-Clause |
def test_domain_range_scale_chromatic_adaptation_Fairchild1990(self) -> None:
"""
Test :func:`colour.adaptation.fairchild1990.\
chromatic_adaptation_Fairchild1990` definition domain and range scale support.
"""
XYZ_1 = np.array([19.53, 23.07, 24.97])
XYZ_n = np.array([111.15, 10... |
Test :func:`colour.adaptation.fairchild1990.chromatic_adaptation_Fairchild1990` definition domain and range scale support.
| test_domain_range_scale_chromatic_adaptation_Fairchild1990 | python | colour-science/colour | colour/adaptation/tests/test_fairchild1990.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_fairchild1990.py | BSD-3-Clause |
def test_nan_chromatic_adaptation_Fairchild1990(self) -> None:
"""
Test :func:`colour.adaptation.fairchild1990.\
chromatic_adaptation_Fairchild1990` definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3)))... |
Test :func:`colour.adaptation.fairchild1990.chromatic_adaptation_Fairchild1990` definition nan support.
| test_nan_chromatic_adaptation_Fairchild1990 | python | colour-science/colour | colour/adaptation/tests/test_fairchild1990.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_fairchild1990.py | BSD-3-Clause |
def test_n_dimensional_matrix_chromatic_adaptation_vk20(self) -> None:
"""
Test :func:`colour.adaptation.fairchild2020.\
matrix_chromatic_adaptation_vk20` definition n-dimensional arrays support.
"""
XYZ_p = np.array([0.95045593, 1.00000000, 1.08905775])
XYZ_n = np.array([0.9642... |
Test :func:`colour.adaptation.fairchild2020.matrix_chromatic_adaptation_vk20` definition n-dimensional arrays support.
| test_n_dimensional_matrix_chromatic_adaptation_vk20 | python | colour-science/colour | colour/adaptation/tests/test_fairchild2020.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_fairchild2020.py | BSD-3-Clause |
def test_domain_range_scale_matrix_chromatic_adaptation_vk20(self) -> None:
"""
Test :func:`colour.adaptation.fairchild2020.\
matrix_chromatic_adaptation_vk20` definition domain and range scale
support.
"""
XYZ_p = np.array([0.95045593, 1.00000000, 1.08905775])
XYZ_n = n... |
Test :func:`colour.adaptation.fairchild2020.matrix_chromatic_adaptation_vk20` definition domain and range scale
support.
| test_domain_range_scale_matrix_chromatic_adaptation_vk20 | python | colour-science/colour | colour/adaptation/tests/test_fairchild2020.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_fairchild2020.py | BSD-3-Clause |
def test_nan_matrix_chromatic_adaptation_vk20(self) -> None:
"""
Test :func:`colour.adaptation.fairchild2020.\
matrix_chromatic_adaptation_vk20` definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
... |
Test :func:`colour.adaptation.fairchild2020.matrix_chromatic_adaptation_vk20` definition nan support.
| test_nan_matrix_chromatic_adaptation_vk20 | python | colour-science/colour | colour/adaptation/tests/test_fairchild2020.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_fairchild2020.py | BSD-3-Clause |
def test_n_dimensional_chromatic_adaptation_vK20(self) -> None:
"""
Test :func:`colour.adaptation.fairchild2020.chromatic_adaptation_vK20`
definition n-dimensional arrays support.
"""
XYZ = np.array([0.20654008, 0.12197225, 0.05136952])
XYZ_p = np.array([0.95045593, 1.00... |
Test :func:`colour.adaptation.fairchild2020.chromatic_adaptation_vK20`
definition n-dimensional arrays support.
| test_n_dimensional_chromatic_adaptation_vK20 | python | colour-science/colour | colour/adaptation/tests/test_fairchild2020.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_fairchild2020.py | BSD-3-Clause |
def test_domain_range_scale_chromatic_adaptation_vK20(self) -> None:
"""
Test :func:`colour.adaptation.fairchild2020.chromatic_adaptation_vK20`
definition domain and range scale support.
"""
XYZ = np.array([0.20654008, 0.12197225, 0.05136952])
XYZ_p = np.array([0.9504559... |
Test :func:`colour.adaptation.fairchild2020.chromatic_adaptation_vK20`
definition domain and range scale support.
| test_domain_range_scale_chromatic_adaptation_vK20 | python | colour-science/colour | colour/adaptation/tests/test_fairchild2020.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_fairchild2020.py | BSD-3-Clause |
def test_nan_chromatic_adaptation_vK20(self) -> None:
"""
Test :func:`colour.adaptation.fairchild2020.chromatic_adaptation_vK20`
definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
ch... |
Test :func:`colour.adaptation.fairchild2020.chromatic_adaptation_vK20`
definition nan support.
| test_nan_chromatic_adaptation_vK20 | python | colour-science/colour | colour/adaptation/tests/test_fairchild2020.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_fairchild2020.py | BSD-3-Clause |
def test_matrix_chromatic_adaptation_VonKries(self) -> None:
"""
Test :func:`colour.adaptation.vonkries.\
matrix_chromatic_adaptation_VonKries` definition.
"""
np.testing.assert_allclose(
matrix_chromatic_adaptation_VonKries(
np.array([0.95045593, 1.00000000,... |
Test :func:`colour.adaptation.vonkries.matrix_chromatic_adaptation_VonKries` definition.
| test_matrix_chromatic_adaptation_VonKries | python | colour-science/colour | colour/adaptation/tests/test_vonkries.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_vonkries.py | BSD-3-Clause |
def test_n_dimensional_matrix_chromatic_adaptation_VonKries(self) -> None:
"""
Test :func:`colour.adaptation.vonkries.\
matrix_chromatic_adaptation_VonKries` definition n-dimensional arrays support.
"""
XYZ_w = np.array([0.95045593, 1.00000000, 1.08905775])
XYZ_wr = np.array([0.... |
Test :func:`colour.adaptation.vonkries.matrix_chromatic_adaptation_VonKries` definition n-dimensional arrays support.
| test_n_dimensional_matrix_chromatic_adaptation_VonKries | python | colour-science/colour | colour/adaptation/tests/test_vonkries.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_vonkries.py | BSD-3-Clause |
def test_domain_range_scale_matrix_chromatic_adaptation_VonKries(self) -> None:
"""
Test :func:`colour.adaptation.vonkries.\
matrix_chromatic_adaptation_VonKries` definition domain and range scale
support.
"""
XYZ_w = np.array([0.95045593, 1.00000000, 1.08905775])
XYZ_wr... |
Test :func:`colour.adaptation.vonkries.matrix_chromatic_adaptation_VonKries` definition domain and range scale
support.
| test_domain_range_scale_matrix_chromatic_adaptation_VonKries | python | colour-science/colour | colour/adaptation/tests/test_vonkries.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_vonkries.py | BSD-3-Clause |
def test_nan_matrix_chromatic_adaptation_VonKries(self) -> None:
"""
Test :func:`colour.adaptation.vonkries.\
matrix_chromatic_adaptation_VonKries` definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))... |
Test :func:`colour.adaptation.vonkries.matrix_chromatic_adaptation_VonKries` definition nan support.
| test_nan_matrix_chromatic_adaptation_VonKries | python | colour-science/colour | colour/adaptation/tests/test_vonkries.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_vonkries.py | BSD-3-Clause |
def test_chromatic_adaptation_VonKries(self) -> None:
"""
Test :func:`colour.adaptation.vonkries.chromatic_adaptation_VonKries`
definition.
"""
np.testing.assert_allclose(
chromatic_adaptation_VonKries(
np.array([0.20654008, 0.12197225, 0.05136952]),
... |
Test :func:`colour.adaptation.vonkries.chromatic_adaptation_VonKries`
definition.
| test_chromatic_adaptation_VonKries | python | colour-science/colour | colour/adaptation/tests/test_vonkries.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_vonkries.py | BSD-3-Clause |
def test_n_dimensional_chromatic_adaptation_VonKries(self) -> None:
"""
Test :func:`colour.adaptation.vonkries.chromatic_adaptation_VonKries`
definition n-dimensional arrays support.
"""
XYZ = np.array([0.20654008, 0.12197225, 0.05136952])
XYZ_w = np.array([0.95045593, 1... |
Test :func:`colour.adaptation.vonkries.chromatic_adaptation_VonKries`
definition n-dimensional arrays support.
| test_n_dimensional_chromatic_adaptation_VonKries | python | colour-science/colour | colour/adaptation/tests/test_vonkries.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_vonkries.py | BSD-3-Clause |
def test_domain_range_scale_chromatic_adaptation_VonKries(self) -> None:
"""
Test :func:`colour.adaptation.vonkries.chromatic_adaptation_VonKries`
definition domain and range scale support.
"""
XYZ = np.array([0.20654008, 0.12197225, 0.05136952])
XYZ_w = np.array([0.9504... |
Test :func:`colour.adaptation.vonkries.chromatic_adaptation_VonKries`
definition domain and range scale support.
| test_domain_range_scale_chromatic_adaptation_VonKries | python | colour-science/colour | colour/adaptation/tests/test_vonkries.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_vonkries.py | BSD-3-Clause |
def test_nan_chromatic_adaptation_VonKries(self) -> None:
"""
Test :func:`colour.adaptation.vonkries.chromatic_adaptation_VonKries`
definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
... |
Test :func:`colour.adaptation.vonkries.chromatic_adaptation_VonKries`
definition nan support.
| test_nan_chromatic_adaptation_VonKries | python | colour-science/colour | colour/adaptation/tests/test_vonkries.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_vonkries.py | BSD-3-Clause |
def test_n_dimensional_chromatic_adaptation_Zhai2018(self) -> None:
"""
Test :func:`colour.adaptation.zhai2018.chromatic_adaptation_Zhai2018`
definition n-dimensional arrays support.
"""
XYZ_b = np.array([48.900, 43.620, 6.250])
XYZ_wb = np.array([109.850, 100, 35.585])
... |
Test :func:`colour.adaptation.zhai2018.chromatic_adaptation_Zhai2018`
definition n-dimensional arrays support.
| test_n_dimensional_chromatic_adaptation_Zhai2018 | python | colour-science/colour | colour/adaptation/tests/test_zhai2018.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_zhai2018.py | BSD-3-Clause |
def test_domain_range_scale_chromatic_adaptation_Zhai2018(self) -> None:
"""
Test :func:`colour.adaptation.zhai2018.chromatic_adaptation_Zhai2018`
definition domain and range scale support.
"""
XYZ_b = np.array([48.900, 43.620, 6.250])
XYZ_wb = np.array([109.850, 100, 35... |
Test :func:`colour.adaptation.zhai2018.chromatic_adaptation_Zhai2018`
definition domain and range scale support.
| test_domain_range_scale_chromatic_adaptation_Zhai2018 | python | colour-science/colour | colour/adaptation/tests/test_zhai2018.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_zhai2018.py | BSD-3-Clause |
def test_nan_chromatic_adaptation_Zhai2018(self) -> None:
"""
Test :func:`colour.adaptation.zhai2018.chromatic_adaptation_Zhai2018`
definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
... |
Test :func:`colour.adaptation.zhai2018.chromatic_adaptation_Zhai2018`
definition nan support.
| test_nan_chromatic_adaptation_Zhai2018 | python | colour-science/colour | colour/adaptation/tests/test_zhai2018.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test_zhai2018.py | BSD-3-Clause |
def test_domain_range_scale_chromatic_adaptation(self) -> None:
"""
Test :func:`colour.adaptation.chromatic_adaptation` definition domain
and range scale support.
"""
XYZ = np.array([0.20654008, 0.12197225, 0.05136952])
XYZ_w = np.array([0.95045593, 1.00000000, 1.0890577... |
Test :func:`colour.adaptation.chromatic_adaptation` definition domain
and range scale support.
| test_domain_range_scale_chromatic_adaptation | python | colour-science/colour | colour/adaptation/tests/test__init__.py | https://github.com/colour-science/colour/blob/master/colour/adaptation/tests/test__init__.py | BSD-3-Clause |
def get_sdiv_mode() -> (
Literal[
"Numpy",
"Ignore",
"Warning",
"Raise",
"Ignore Zero Conversion",
"Warning Zero Conversion",
"Ignore Limit Conversion",
"Warning Limit Conversion",
]
):
"""
Return *Colour* safe division mode.
Returns
... |
Return *Colour* safe division mode.
Returns
-------
:class:`str`
*Colour* safe division mode, see :func:`colour.algebra.sdiv` definition
for an explanation about the possible modes.
Examples
--------
>>> with sdiv_mode("Numpy"):
... get_sdiv_mode()
'numpy'
... | get_sdiv_mode | python | colour-science/colour | colour/algebra/common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/common.py | BSD-3-Clause |
def set_sdiv_mode(
mode: (
Literal[
"Numpy",
"Ignore",
"Warning",
"Raise",
"Ignore Zero Conversion",
"Warning Zero Conversion",
"Ignore Limit Conversion",
"Warning Limit Conversion",
]
| str
)... |
Set *Colour* safe division function mode.
Parameters
----------
mode
*Colour* safe division mode, see :func:`colour.algebra.sdiv` definition
for an explanation about the possible modes.
Examples
--------
>>> with sdiv_mode(get_sdiv_mode()):
... print(get_sdiv_mode(... | set_sdiv_mode | python | colour-science/colour | colour/algebra/common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/common.py | BSD-3-Clause |
def set_spow_enable(enable: bool) -> None:
"""
Set *Colour* safe / symmetrical power function enabled state.
Parameters
----------
enable
Whether to enable *Colour* safe / symmetrical power function.
Examples
--------
>>> with spow_enable(is_spow_enabled()):
... print(i... |
Set *Colour* safe / symmetrical power function enabled state.
Parameters
----------
enable
Whether to enable *Colour* safe / symmetrical power function.
Examples
--------
>>> with spow_enable(is_spow_enabled()):
... print(is_spow_enabled())
... set_spow_enable(Fals... | set_spow_enable | python | colour-science/colour | colour/algebra/common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/common.py | BSD-3-Clause |
def spow(a: ArrayLike, p: ArrayLike) -> DTypeFloat | NDArrayFloat:
"""
Raise specified array :math:`a` to the power :math:`p` as follows:
:math:`sign(a) * |a|^p`.
This definition avoids NaNs generation when array :math:`a` is negative and
the power :math:`p` is fractional. This behaviour can be ena... |
Raise specified array :math:`a` to the power :math:`p` as follows:
:math:`sign(a) * |a|^p`.
This definition avoids NaNs generation when array :math:`a` is negative and
the power :math:`p` is fractional. This behaviour can be enabled or
disabled with the :func:`colour.algebra.set_spow_enable` defin... | spow | python | colour-science/colour | colour/algebra/common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/common.py | BSD-3-Clause |
def normalise_vector(a: ArrayLike) -> NDArrayFloat:
"""
Normalise specified vector :math:`a`.
Parameters
----------
a
Vector :math:`a` to normalise.
Returns
-------
:class:`numpy.ndarray`
Normalised vector :math:`a`.
Examples
--------
>>> a = np.array([0.20... |
Normalise specified vector :math:`a`.
Parameters
----------
a
Vector :math:`a` to normalise.
Returns
-------
:class:`numpy.ndarray`
Normalised vector :math:`a`.
Examples
--------
>>> a = np.array([0.20654008, 0.12197225, 0.05136952])
>>> normalise_vector(a... | normalise_vector | python | colour-science/colour | colour/algebra/common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/common.py | BSD-3-Clause |
def normalise_maximum(
a: ArrayLike,
axis: int | None = None,
factor: float = 1,
clip: bool = True,
) -> NDArrayFloat:
"""
Normalise specified array :math:`a` values by :math:`a` maximum value and
optionally clip them between.
Parameters
----------
a
Array :math:`a` to n... |
Normalise specified array :math:`a` values by :math:`a` maximum value and
optionally clip them between.
Parameters
----------
a
Array :math:`a` to normalise.
axis
Normalization axis.
factor
Normalization factor.
clip
Clip values to domain [0, 'factor'].
... | normalise_maximum | python | colour-science/colour | colour/algebra/common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/common.py | BSD-3-Clause |
def linear_conversion(
a: ArrayLike, old_range: ArrayLike, new_range: ArrayLike
) -> NDArrayFloat:
"""
Perform a simple linear conversion of specified array :math:`a` between the
old and new ranges.
Parameters
----------
a
Array :math:`a` to perform the linear conversion onto.
o... |
Perform a simple linear conversion of specified array :math:`a` between the
old and new ranges.
Parameters
----------
a
Array :math:`a` to perform the linear conversion onto.
old_range
Old range.
new_range
New range.
Returns
-------
:class:`numpy.ndarra... | linear_conversion | python | colour-science/colour | colour/algebra/common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/common.py | BSD-3-Clause |
def linstep_function(
x: ArrayLike,
a: ArrayLike = 0,
b: ArrayLike = 1,
clip: bool = False,
) -> NDArrayFloat:
"""
Perform a simple linear interpolation between specified array :math:`a` and
array :math:`b` using :math:`x` array.
Parameters
----------
x
Array :math:`x` v... |
Perform a simple linear interpolation between specified array :math:`a` and
array :math:`b` using :math:`x` array.
Parameters
----------
x
Array :math:`x` value to use to interpolate between array :math:`a` and
array :math:`b`.
a
Array :math:`a`, the start of the range ... | linstep_function | python | colour-science/colour | colour/algebra/common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/common.py | BSD-3-Clause |
def eigen_decomposition(
a: ArrayLike,
eigen_w_v_count: int | None = None,
descending_order: bool = True,
covariance_matrix: bool = False,
) -> Tuple[NDArrayFloat, NDArrayFloat]:
"""
Return the eigen-values :math:`w` and eigen-vectors :math:`v` of specified
array :math:`a` in specified order... |
Return the eigen-values :math:`w` and eigen-vectors :math:`v` of specified
array :math:`a` in specified order.
Parameters
----------
a
Array to return the eigen-values :math:`w` and eigen-vectors :math:`v`
for
eigen_w_v_count
Eigen-values :math:`w` and eigen-vectors :ma... | eigen_decomposition | python | colour-science/colour | colour/algebra/common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/common.py | BSD-3-Clause |
def interpolator(self, value: ProtocolInterpolator) -> None:
"""Setter for the **self.interpolator** property."""
attest(
hasattr(value, "x"),
f'"{value}" interpolator has no "x" attribute!',
)
attest(
hasattr(value, "y"),
f'"{value}" int... | Setter for the **self.interpolator** property. | interpolator | python | colour-science/colour | colour/algebra/extrapolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/extrapolation.py | BSD-3-Clause |
def method(self, value: Literal["Linear", "Constant"] | str) -> None:
"""Setter for the **self.method** property."""
attest(
isinstance(value, str),
f'"method" property: "{value}" type is not "str"!',
)
value = validate_method(value, ("Linear", "Constant"))
... | Setter for the **self.method** property. | method | python | colour-science/colour | colour/algebra/extrapolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/extrapolation.py | BSD-3-Clause |
def left(self, value: Real | None) -> None:
"""Setter for the **self.left** property."""
if value is not None:
attest(
is_numeric(value),
f'"left" property: "{value}" is not a "number"!',
)
self._left = value | Setter for the **self.left** property. | left | python | colour-science/colour | colour/algebra/extrapolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/extrapolation.py | BSD-3-Clause |
def right(self, value: Real | None) -> None:
"""Setter for the **self.right** property."""
if value is not None:
attest(
is_numeric(value),
f'"right" property: "{value}" is not a "number"!',
)
self._right = value | Setter for the **self.right** property. | right | python | colour-science/colour | colour/algebra/extrapolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/extrapolation.py | BSD-3-Clause |
def __call__(self, x: ArrayLike) -> NDArrayFloat:
"""
Evaluate the Extrapolator at specified point(s).
Parameters
----------
x
Point(s) to evaluate the Extrapolator at.
Returns
-------
:class:`numpy.ndarray`
Extrapolated points va... |
Evaluate the Extrapolator at specified point(s).
Parameters
----------
x
Point(s) to evaluate the Extrapolator at.
Returns
-------
:class:`numpy.ndarray`
Extrapolated points value(s).
| __call__ | python | colour-science/colour | colour/algebra/extrapolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/extrapolation.py | BSD-3-Clause |
def _evaluate(self, x: NDArrayFloat) -> NDArrayFloat:
"""
Perform the extrapolating evaluation at specified points.
Parameters
----------
x
Points to evaluate the Extrapolator at.
Returns
-------
:class:`numpy.ndarray`
Extrapolate... |
Perform the extrapolating evaluation at specified points.
Parameters
----------
x
Points to evaluate the Extrapolator at.
Returns
-------
:class:`numpy.ndarray`
Extrapolated points values.
| _evaluate | python | colour-science/colour | colour/algebra/extrapolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/extrapolation.py | BSD-3-Clause |
def kernel_sinc(x: ArrayLike, a: float = 3) -> NDArrayFloat:
"""
Return the *sinc* kernel evaluated at specified samples.
Parameters
----------
x
Samples at which to evaluate the *sinc* kernel.
a
Size of the *sinc* kernel.
Returns
-------
:class:`numpy.ndarray`
... |
Return the *sinc* kernel evaluated at specified samples.
Parameters
----------
x
Samples at which to evaluate the *sinc* kernel.
a
Size of the *sinc* kernel.
Returns
-------
:class:`numpy.ndarray`
The *sinc* kernel evaluated at specified samples.
Reference... | kernel_sinc | python | colour-science/colour | colour/algebra/interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/interpolation.py | BSD-3-Clause |
def kernel_lanczos(x: ArrayLike, a: float = 3) -> NDArrayFloat:
"""
Return the *lanczos* kernel evaluated at specified samples.
Parameters
----------
x
Samples at which to evaluate the *lanczos* kernel.
a
Size of the *lanczos* kernel.
Returns
-------
:class:`numpy.n... |
Return the *lanczos* kernel evaluated at specified samples.
Parameters
----------
x
Samples at which to evaluate the *lanczos* kernel.
a
Size of the *lanczos* kernel.
Returns
-------
:class:`numpy.ndarray`
The *lanczos* kernel evaluated at specified samples.
... | kernel_lanczos | python | colour-science/colour | colour/algebra/interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/interpolation.py | BSD-3-Clause |
def window(self, value: float) -> None:
"""Setter for the **self.window** property."""
attest(bool(value >= 1), '"window" must be equal to or greater than 1!')
self._window = value
# Triggering "self._x_p" update.
if self._x is not None:
self.x = self._x
#... | Setter for the **self.window** property. | window | python | colour-science/colour | colour/algebra/interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/interpolation.py | BSD-3-Clause |
def kernel(self, value: Callable) -> None:
"""Setter for the **self.kernel** property."""
attest(
callable(value),
f'"kernel" property: "{value}" is not callable!',
)
self._kernel = value | Setter for the **self.kernel** property. | kernel | python | colour-science/colour | colour/algebra/interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/interpolation.py | BSD-3-Clause |
def __call__(self, x: ArrayLike) -> NDArrayFloat:
"""
Evaluate the interpolator at specified point(s).
Parameters
----------
x
Point(s) to evaluate the interpolant at.
Returns
-------
:class:`numpy.ndarray`
Interpolated value(s).
... |
Evaluate the interpolator at specified point(s).
Parameters
----------
x
Point(s) to evaluate the interpolant at.
Returns
-------
:class:`numpy.ndarray`
Interpolated value(s).
| __call__ | python | colour-science/colour | colour/algebra/interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/interpolation.py | BSD-3-Clause |
def _evaluate(self, x: NDArrayFloat) -> NDArrayFloat:
"""
Perform the interpolator evaluation at specified points.
Parameters
----------
x
Points to evaluate the interpolant at.
Returns
-------
:class:`numpy.ndarray`
Interpolated ... |
Perform the interpolator evaluation at specified points.
Parameters
----------
x
Points to evaluate the interpolant at.
Returns
-------
:class:`numpy.ndarray`
Interpolated points values.
| _evaluate | python | colour-science/colour | colour/algebra/interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/interpolation.py | BSD-3-Clause |
def _validate_dimensions(self) -> None:
"""Validate that the variables dimensions are the same."""
if len(self._x) != len(self._y):
error = (
'"x" independent and "y" dependent variables have different '
f'dimensions: "{len(self._x)}", "{len(self._y)}"'
... | Validate that the variables dimensions are the same. | _validate_dimensions | python | colour-science/colour | colour/algebra/interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/interpolation.py | BSD-3-Clause |
def _validate_interpolation_range(self, x: NDArrayFloat) -> None:
"""Validate specified point to be in interpolation range."""
below_interpolation_range = x < self._x[0]
above_interpolation_range = x > self._x[-1]
if below_interpolation_range.any():
error = f'"{x}" is below... | Validate specified point to be in interpolation range. | _validate_interpolation_range | python | colour-science/colour | colour/algebra/interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/interpolation.py | BSD-3-Clause |
def __call__(self, x: ArrayLike) -> NDArrayFloat:
"""
Evaluate the interpolating polynomial at specified point(s).
Parameters
----------
x
Point(s) to evaluate the interpolant at.
Returns
-------
:class:`numpy.ndarray`
Interpolat... |
Evaluate the interpolating polynomial at specified point(s).
Parameters
----------
x
Point(s) to evaluate the interpolant at.
Returns
-------
:class:`numpy.ndarray`
Interpolated value(s).
| __call__ | python | colour-science/colour | colour/algebra/interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/interpolation.py | BSD-3-Clause |
def _evaluate(self, x: NDArrayFloat) -> NDArrayFloat:
"""
Perform the interpolating polynomial evaluation at specified points.
Parameters
----------
x
Points to evaluate the interpolant at.
Returns
-------
:class:`numpy.ndarray`
I... |
Perform the interpolating polynomial evaluation at specified points.
Parameters
----------
x
Points to evaluate the interpolant at.
Returns
-------
:class:`numpy.ndarray`
Interpolated points values.
| _evaluate | python | colour-science/colour | colour/algebra/interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/interpolation.py | BSD-3-Clause |
def __call__(self, x: ArrayLike) -> NDArrayFloat:
"""
Evaluate the interpolating polynomial at specified point(s).
Parameters
----------
x
Point(s) to evaluate the interpolant at.
Returns
-------
:class:`numpy.ndarray`
Interpolate... |
Evaluate the interpolating polynomial at specified point(s).
Parameters
----------
x
Point(s) to evaluate the interpolant at.
Returns
-------
:class:`numpy.ndarray`
Interpolated value(s).
| __call__ | python | colour-science/colour | colour/algebra/interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/interpolation.py | BSD-3-Clause |
def _evaluate(self, x: NDArrayFloat) -> NDArrayFloat:
"""
Perform the interpolating polynomial evaluation at specified point.
Parameters
----------
x
Point to evaluate the interpolant at.
Returns
-------
:class:`numpy.ndarray`
Int... |
Perform the interpolating polynomial evaluation at specified point.
Parameters
----------
x
Point to evaluate the interpolant at.
Returns
-------
:class:`numpy.ndarray`
Interpolated point values.
| _evaluate | python | colour-science/colour | colour/algebra/interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/interpolation.py | BSD-3-Clause |
def default(self, value: float) -> None:
"""Setter for the **self.default** property."""
attest(is_numeric(value), '"default" variable must be a "numeric"!')
self._default = value | Setter for the **self.default** property. | default | python | colour-science/colour | colour/algebra/interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/interpolation.py | BSD-3-Clause |
def __call__(self, x: ArrayLike) -> NDArrayFloat:
"""
Evaluate the interpolator at specified point(s).
Parameters
----------
x
Point(s) to evaluate the interpolant at.
Returns
-------
:class:`numpy.ndarray`
Interpolated value(s).... |
Evaluate the interpolator at specified point(s).
Parameters
----------
x
Point(s) to evaluate the interpolant at.
Returns
-------
:class:`numpy.ndarray`
Interpolated value(s).
| __call__ | python | colour-science/colour | colour/algebra/interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/interpolation.py | BSD-3-Clause |
def lagrange_coefficients(r: float, n: int = 4) -> NDArrayFloat:
"""
Compute the *Lagrange Coefficients* at specified point :math:`r` for degree
:math:`n`.
Parameters
----------
r
Point to get the *Lagrange Coefficients* at.
n
Degree of the *Lagrange Coefficients* being calc... |
Compute the *Lagrange Coefficients* at specified point :math:`r` for degree
:math:`n`.
Parameters
----------
r
Point to get the *Lagrange Coefficients* at.
n
Degree of the *Lagrange Coefficients* being calculated.
Returns
-------
:class:`numpy.ndarray`
Referen... | lagrange_coefficients | python | colour-science/colour | colour/algebra/interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/interpolation.py | BSD-3-Clause |
def vertices_and_relative_coordinates(
V_xyz: ArrayLike, table: ArrayLike
) -> Tuple[NDArrayFloat, NDArrayFloat]:
"""
Compute the vertices coordinates and indexes relative :math:`V_{xyzr}`
coordinates from specified :math:`V_{xyzr}` values and interpolation table.
Parameters
----------
V_xy... |
Compute the vertices coordinates and indexes relative :math:`V_{xyzr}`
coordinates from specified :math:`V_{xyzr}` values and interpolation table.
Parameters
----------
V_xyz
:math:`V_{xyz}` values to transform to indexes relative
:math:`V_{xyzr}` values.
table
4-Dimens... | vertices_and_relative_coordinates | python | colour-science/colour | colour/algebra/interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/interpolation.py | BSD-3-Clause |
def table_interpolation_trilinear(V_xyz: ArrayLike, table: ArrayLike) -> NDArrayFloat:
"""
Perform the trilinear interpolation of specified :math:`V_{xyz}` values
using specified interpolation table.
Parameters
----------
V_xyz
:math:`V_{xyz}` values to interpolate.
table
4-... |
Perform the trilinear interpolation of specified :math:`V_{xyz}` values
using specified interpolation table.
Parameters
----------
V_xyz
:math:`V_{xyz}` values to interpolate.
table
4-Dimensional (NxNxNx3) interpolation table.
Returns
-------
:class:`numpy.ndarray`... | table_interpolation_trilinear | python | colour-science/colour | colour/algebra/interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/interpolation.py | BSD-3-Clause |
def table_interpolation_tetrahedral(V_xyz: ArrayLike, table: ArrayLike) -> NDArrayFloat:
"""
Perform the tetrahedral interpolation of specified :math:`V_{xyz}` values
using specified interpolation table.
Parameters
----------
V_xyz
:math:`V_{xyz}` values to interpolate.
table
... |
Perform the tetrahedral interpolation of specified :math:`V_{xyz}` values
using specified interpolation table.
Parameters
----------
V_xyz
:math:`V_{xyz}` values to interpolate.
table
4-Dimensional (NxNxNx3) interpolation table.
Returns
-------
:class:`numpy.ndarra... | table_interpolation_tetrahedral | python | colour-science/colour | colour/algebra/interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/interpolation.py | BSD-3-Clause |
def table_interpolation(
V_xyz: ArrayLike,
table: ArrayLike,
method: Literal["Trilinear", "Tetrahedral"] | str = "Trilinear",
) -> NDArrayFloat:
"""
Perform interpolation of specified :math:`V_{xyz}` values using specified
interpolation table.
Parameters
----------
V_xyz
:ma... |
Perform interpolation of specified :math:`V_{xyz}` values using specified
interpolation table.
Parameters
----------
V_xyz
:math:`V_{xyz}` values to interpolate.
table
4-Dimensional (NxNxNx3) interpolation table.
method
Interpolation method.
Returns
-------... | table_interpolation | python | colour-science/colour | colour/algebra/interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/interpolation.py | BSD-3-Clause |
def least_square_mapping_MoorePenrose(y: ArrayLike, x: ArrayLike) -> NDArrayFloat:
"""
Compute the *least-squares* mapping from dependent variable :math:`y` to
independent variable :math:`x` using *Moore-Penrose* inverse.
Parameters
----------
y
Dependent and already known :math:`y` var... |
Compute the *least-squares* mapping from dependent variable :math:`y` to
independent variable :math:`x` using *Moore-Penrose* inverse.
Parameters
----------
y
Dependent and already known :math:`y` variable.
x
Independent :math:`x` variable(s) values corresponding with :math:`y`... | least_square_mapping_MoorePenrose | python | colour-science/colour | colour/algebra/regression.py | https://github.com/colour-science/colour/blob/master/colour/algebra/regression.py | BSD-3-Clause |
def cartesian_to_spherical(a: ArrayLike) -> NDArrayFloat:
"""
Transform specified cartesian coordinates array :math:`xyz` to spherical
coordinates array :math:`\\rho\\theta\\phi` (radial distance, inclination
or elevation and azimuth).
Parameters
----------
a
Cartesian coordinates a... |
Transform specified cartesian coordinates array :math:`xyz` to spherical
coordinates array :math:`\rho\theta\phi` (radial distance, inclination
or elevation and azimuth).
Parameters
----------
a
Cartesian coordinates array :math:`xyz` to transform.
Returns
-------
:class:`... | cartesian_to_spherical | python | colour-science/colour | colour/algebra/coordinates/transformations.py | https://github.com/colour-science/colour/blob/master/colour/algebra/coordinates/transformations.py | BSD-3-Clause |
def spherical_to_cartesian(a: ArrayLike) -> NDArrayFloat:
"""
Transform specified spherical coordinates array :math:`\\rho\\theta\\phi`
(radial distance, inclination or elevation and azimuth) to cartesian
coordinates array :math:`xyz`.
Parameters
----------
a
Spherical coordinates a... |
Transform specified spherical coordinates array :math:`\rho\theta\phi`
(radial distance, inclination or elevation and azimuth) to cartesian
coordinates array :math:`xyz`.
Parameters
----------
a
Spherical coordinates array :math:`\rho\theta\phi` to transform,
:math:`\rho` is in... | spherical_to_cartesian | python | colour-science/colour | colour/algebra/coordinates/transformations.py | https://github.com/colour-science/colour/blob/master/colour/algebra/coordinates/transformations.py | BSD-3-Clause |
def cartesian_to_polar(a: ArrayLike) -> NDArrayFloat:
"""
Transform specified cartesian coordinates array :math:`xy` to polar
coordinates array :math:`\\rho\\phi` (radial coordinate, angular
coordinate).
Parameters
----------
a
Cartesian coordinates array :math:`xy` to transform.
... |
Transform specified cartesian coordinates array :math:`xy` to polar
coordinates array :math:`\rho\phi` (radial coordinate, angular
coordinate).
Parameters
----------
a
Cartesian coordinates array :math:`xy` to transform.
Returns
-------
:class:`numpy.ndarray`
Polar... | cartesian_to_polar | python | colour-science/colour | colour/algebra/coordinates/transformations.py | https://github.com/colour-science/colour/blob/master/colour/algebra/coordinates/transformations.py | BSD-3-Clause |
def polar_to_cartesian(a: ArrayLike) -> NDArrayFloat:
"""
Transform specified polar coordinates array :math:`\\rho\\phi` (radial
coordinate, angular coordinate) to cartesian coordinates array :math:`xy`.
Parameters
----------
a
Polar coordinates array :math:`\\rho\\phi` to transform, :m... |
Transform specified polar coordinates array :math:`\rho\phi` (radial
coordinate, angular coordinate) to cartesian coordinates array :math:`xy`.
Parameters
----------
a
Polar coordinates array :math:`\rho\phi` to transform, :math:`\rho`
is in range [0, +inf], :math:`\phi` is in rang... | polar_to_cartesian | python | colour-science/colour | colour/algebra/coordinates/transformations.py | https://github.com/colour-science/colour/blob/master/colour/algebra/coordinates/transformations.py | BSD-3-Clause |
def cartesian_to_cylindrical(a: ArrayLike) -> NDArrayFloat:
"""
Transform specified cartesian coordinates array :math:`xyz` to cylindrical
coordinates array :math:`\\rho\\phi z` (radial distance, azimuth and
height).
Parameters
----------
a
Cartesian coordinates array :math:`xyz` to... |
Transform specified cartesian coordinates array :math:`xyz` to cylindrical
coordinates array :math:`\rho\phi z` (radial distance, azimuth and
height).
Parameters
----------
a
Cartesian coordinates array :math:`xyz` to transform.
Returns
-------
:class:`numpy.ndarray`
... | cartesian_to_cylindrical | python | colour-science/colour | colour/algebra/coordinates/transformations.py | https://github.com/colour-science/colour/blob/master/colour/algebra/coordinates/transformations.py | BSD-3-Clause |
def cylindrical_to_cartesian(a: ArrayLike) -> NDArrayFloat:
"""
Transform specified cylindrical coordinates array :math:`\\rho\\phi z`
(radial distance, azimuth and height) to cartesian coordinates array
:math:`xyz`.
Parameters
----------
a
Cylindrical coordinates array :math:`\\rho... |
Transform specified cylindrical coordinates array :math:`\rho\phi z`
(radial distance, azimuth and height) to cartesian coordinates array
:math:`xyz`.
Parameters
----------
a
Cylindrical coordinates array :math:`\rho\phi z` to transform,
:math:`\rho` is in range [0, +inf], :mat... | cylindrical_to_cartesian | python | colour-science/colour | colour/algebra/coordinates/transformations.py | https://github.com/colour-science/colour/blob/master/colour/algebra/coordinates/transformations.py | BSD-3-Clause |
def test_cartesian_to_spherical(self) -> None:
"""
Test :func:`colour.algebra.coordinates.transformations.\
cartesian_to_spherical` definition.
"""
np.testing.assert_allclose(
cartesian_to_spherical(np.array([3, 1, 6])),
np.array([6.78232998, 0.48504979, 0.321750... |
Test :func:`colour.algebra.coordinates.transformations.cartesian_to_spherical` definition.
| test_cartesian_to_spherical | python | colour-science/colour | colour/algebra/coordinates/tests/test_transformations.py | https://github.com/colour-science/colour/blob/master/colour/algebra/coordinates/tests/test_transformations.py | BSD-3-Clause |
def test_n_dimensional_cartesian_to_spherical(self) -> None:
"""
Test :func:`colour.algebra.coordinates.transformations.\
cartesian_to_spherical` definition n-dimensional arrays support.
"""
a_i = np.array([3, 1, 6])
a_o = cartesian_to_spherical(a_i)
a_i = np.tile(a_i, ... |
Test :func:`colour.algebra.coordinates.transformations.cartesian_to_spherical` definition n-dimensional arrays support.
| test_n_dimensional_cartesian_to_spherical | python | colour-science/colour | colour/algebra/coordinates/tests/test_transformations.py | https://github.com/colour-science/colour/blob/master/colour/algebra/coordinates/tests/test_transformations.py | BSD-3-Clause |
def test_nan_cartesian_to_spherical(self) -> None:
"""
Test :func:`colour.algebra.coordinates.transformations.\
cartesian_to_spherical` definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
car... |
Test :func:`colour.algebra.coordinates.transformations.cartesian_to_spherical` definition nan support.
| test_nan_cartesian_to_spherical | python | colour-science/colour | colour/algebra/coordinates/tests/test_transformations.py | https://github.com/colour-science/colour/blob/master/colour/algebra/coordinates/tests/test_transformations.py | BSD-3-Clause |
def test_spherical_to_cartesian(self) -> None:
"""
Test :func:`colour.algebra.coordinates.transformations.\
spherical_to_cartesian` definition.
"""
np.testing.assert_allclose(
spherical_to_cartesian(np.array([6.78232998, 0.48504979, 0.32175055])),
np.array([3.000... |
Test :func:`colour.algebra.coordinates.transformations.spherical_to_cartesian` definition.
| test_spherical_to_cartesian | python | colour-science/colour | colour/algebra/coordinates/tests/test_transformations.py | https://github.com/colour-science/colour/blob/master/colour/algebra/coordinates/tests/test_transformations.py | BSD-3-Clause |
def test_n_dimensional_spherical_to_cartesian(self) -> None:
"""
Test :func:`colour.algebra.coordinates.transformations.\
spherical_to_cartesian` definition n-dimensional arrays support.
"""
a_i = np.array([6.78232998, 0.48504979, 0.32175055])
a_o = spherical_to_cartesian(a_i)
... |
Test :func:`colour.algebra.coordinates.transformations.spherical_to_cartesian` definition n-dimensional arrays support.
| test_n_dimensional_spherical_to_cartesian | python | colour-science/colour | colour/algebra/coordinates/tests/test_transformations.py | https://github.com/colour-science/colour/blob/master/colour/algebra/coordinates/tests/test_transformations.py | BSD-3-Clause |
def test_nan_spherical_to_cartesian(self) -> None:
"""
Test :func:`colour.algebra.coordinates.transformations.\
spherical_to_cartesian` definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
sph... |
Test :func:`colour.algebra.coordinates.transformations.spherical_to_cartesian` definition nan support.
| test_nan_spherical_to_cartesian | python | colour-science/colour | colour/algebra/coordinates/tests/test_transformations.py | https://github.com/colour-science/colour/blob/master/colour/algebra/coordinates/tests/test_transformations.py | BSD-3-Clause |
def test_cartesian_to_polar(self) -> None:
"""
Test :func:`colour.algebra.coordinates.transformations.\
cartesian_to_polar` definition.
"""
np.testing.assert_allclose(
cartesian_to_polar(np.array([3, 1])),
np.array([3.16227766, 0.32175055]),
atol=TOLE... |
Test :func:`colour.algebra.coordinates.transformations.cartesian_to_polar` definition.
| test_cartesian_to_polar | python | colour-science/colour | colour/algebra/coordinates/tests/test_transformations.py | https://github.com/colour-science/colour/blob/master/colour/algebra/coordinates/tests/test_transformations.py | BSD-3-Clause |
def test_n_dimensional_cartesian_to_polar(self) -> None:
"""
Test :func:`colour.algebra.coordinates.transformations.\
cartesian_to_polar` definition n-dimensional arrays support.
"""
a_i = np.array([3, 1])
a_o = cartesian_to_polar(a_i)
a_i = np.tile(a_i, (6, 1))
... |
Test :func:`colour.algebra.coordinates.transformations.cartesian_to_polar` definition n-dimensional arrays support.
| test_n_dimensional_cartesian_to_polar | python | colour-science/colour | colour/algebra/coordinates/tests/test_transformations.py | https://github.com/colour-science/colour/blob/master/colour/algebra/coordinates/tests/test_transformations.py | BSD-3-Clause |
def test_nan_cartesian_to_polar(self) -> None:
"""
Test :func:`colour.algebra.coordinates.transformations.\
cartesian_to_polar` definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=2))))
cartesian_t... |
Test :func:`colour.algebra.coordinates.transformations.cartesian_to_polar` definition nan support.
| test_nan_cartesian_to_polar | python | colour-science/colour | colour/algebra/coordinates/tests/test_transformations.py | https://github.com/colour-science/colour/blob/master/colour/algebra/coordinates/tests/test_transformations.py | BSD-3-Clause |
def test_polar_to_cartesian(self) -> None:
"""
Test :func:`colour.algebra.coordinates.transformations.\
polar_to_cartesian` definition.
"""
np.testing.assert_allclose(
polar_to_cartesian(np.array([0.32175055, 1.08574654])),
np.array([0.15001697, 0.28463718]),
... |
Test :func:`colour.algebra.coordinates.transformations.polar_to_cartesian` definition.
| test_polar_to_cartesian | python | colour-science/colour | colour/algebra/coordinates/tests/test_transformations.py | https://github.com/colour-science/colour/blob/master/colour/algebra/coordinates/tests/test_transformations.py | BSD-3-Clause |
def test_n_dimensional_polar_to_cartesian(self) -> None:
"""
Test :func:`colour.algebra.coordinates.transformations.\
polar_to_cartesian` definition n-dimensional arrays support.
"""
a_i = np.array([3.16227766, 0.32175055])
a_o = polar_to_cartesian(a_i)
a_i = np.tile(a_... |
Test :func:`colour.algebra.coordinates.transformations.polar_to_cartesian` definition n-dimensional arrays support.
| test_n_dimensional_polar_to_cartesian | python | colour-science/colour | colour/algebra/coordinates/tests/test_transformations.py | https://github.com/colour-science/colour/blob/master/colour/algebra/coordinates/tests/test_transformations.py | BSD-3-Clause |
def test_nan_polar_to_cartesian(self) -> None:
"""
Test :func:`colour.algebra.coordinates.transformations.\
polar_to_cartesian` definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=2))))
polar_to_ca... |
Test :func:`colour.algebra.coordinates.transformations.polar_to_cartesian` definition nan support.
| test_nan_polar_to_cartesian | python | colour-science/colour | colour/algebra/coordinates/tests/test_transformations.py | https://github.com/colour-science/colour/blob/master/colour/algebra/coordinates/tests/test_transformations.py | BSD-3-Clause |
def test_cartesian_to_cylindrical(self) -> None:
"""
Test :func:`colour.algebra.coordinates.transformations.\
cartesian_to_cylindrical` definition.
"""
np.testing.assert_allclose(
cartesian_to_cylindrical(np.array([3, 1, 6])),
np.array([3.16227766, 0.32175055, 6.... |
Test :func:`colour.algebra.coordinates.transformations.cartesian_to_cylindrical` definition.
| test_cartesian_to_cylindrical | python | colour-science/colour | colour/algebra/coordinates/tests/test_transformations.py | https://github.com/colour-science/colour/blob/master/colour/algebra/coordinates/tests/test_transformations.py | BSD-3-Clause |
def test_n_dimensional_cartesian_to_cylindrical(self) -> None:
"""
Test :func:`colour.algebra.coordinates.transformations.\
cartesian_to_cylindrical` definition n-dimensional arrays support.
"""
a_i = np.array([3, 1, 6])
a_o = cartesian_to_cylindrical(a_i)
a_i = np.tile... |
Test :func:`colour.algebra.coordinates.transformations.cartesian_to_cylindrical` definition n-dimensional arrays support.
| test_n_dimensional_cartesian_to_cylindrical | python | colour-science/colour | colour/algebra/coordinates/tests/test_transformations.py | https://github.com/colour-science/colour/blob/master/colour/algebra/coordinates/tests/test_transformations.py | BSD-3-Clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.