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 test_nan_cartesian_to_cylindrical(self) -> None:
"""
Test :func:`colour.algebra.coordinates.transformations.\
cartesian_to_cylindrical` 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.algebra.coordinates.transformations.cartesian_to_cylindrical` definition nan support.
| test_nan_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_cylindrical_to_cartesian(self) -> None:
"""
Test :func:`colour.algebra.coordinates.transformations.\
cylindrical_to_cartesian` definition.
"""
np.testing.assert_allclose(
cylindrical_to_cartesian(np.array([0.32175055, 1.08574654, 6.78232998])),
np.array(... |
Test :func:`colour.algebra.coordinates.transformations.cylindrical_to_cartesian` definition.
| test_cylindrical_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_cylindrical_to_cartesian(self) -> None:
"""
Test :func:`colour.algebra.coordinates.transformations.\
cylindrical_to_cartesian` definition n-dimensional arrays support.
"""
a_i = np.array([3.16227766, 0.32175055, 6.00000000])
a_o = cylindrical_to_cartesian(... |
Test :func:`colour.algebra.coordinates.transformations.cylindrical_to_cartesian` definition n-dimensional arrays support.
| test_n_dimensional_cylindrical_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_cylindrical_to_cartesian(self) -> None:
"""
Test :func:`colour.algebra.coordinates.transformations.\
cylindrical_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))))
... |
Test :func:`colour.algebra.coordinates.transformations.cylindrical_to_cartesian` definition nan support.
| test_nan_cylindrical_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_get_sdiv_mode(self) -> None:
"""Test :func:`colour.algebra.common.get_sdiv_mode` definition."""
with sdiv_mode("Numpy"):
assert get_sdiv_mode() == "numpy"
with sdiv_mode("Ignore"):
assert get_sdiv_mode() == "ignore"
with sdiv_mode("Warning"):
... | Test :func:`colour.algebra.common.get_sdiv_mode` definition. | test_get_sdiv_mode | python | colour-science/colour | colour/algebra/tests/test_common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_common.py | BSD-3-Clause |
def test_set_sdiv_mode(self) -> None:
"""Test :func:`colour.algebra.common.set_sdiv_mode` definition."""
with sdiv_mode(get_sdiv_mode()):
set_sdiv_mode("Numpy")
assert get_sdiv_mode() == "numpy"
set_sdiv_mode("Ignore")
assert get_sdiv_mode() == "ignore"
... | Test :func:`colour.algebra.common.set_sdiv_mode` definition. | test_set_sdiv_mode | python | colour-science/colour | colour/algebra/tests/test_common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_common.py | BSD-3-Clause |
def test_sdiv_mode(self) -> None:
"""Test :func:`colour.algebra.common.sdiv_mode` definition."""
with sdiv_mode("Raise"):
assert get_sdiv_mode() == "raise"
with sdiv_mode("Ignore Zero Conversion"):
assert get_sdiv_mode() == "ignore zero conversion"
@sdiv_mode("... | Test :func:`colour.algebra.common.sdiv_mode` definition. | test_sdiv_mode | python | colour-science/colour | colour/algebra/tests/test_common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_common.py | BSD-3-Clause |
def test_sdiv(self) -> None:
"""Test :func:`colour.algebra.common.sdiv` definition."""
a = np.array([0, 1, 2])
b = np.array([2, 1, 0])
with sdiv_mode("Numpy"):
pytest.warns(RuntimeWarning, sdiv, a, b)
with sdiv_mode("Ignore"):
np.testing.assert_equal(sd... | Test :func:`colour.algebra.common.sdiv` definition. | test_sdiv | python | colour-science/colour | colour/algebra/tests/test_common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_common.py | BSD-3-Clause |
def test_is_spow_enabled(self) -> None:
"""Test :func:`colour.algebra.common.is_spow_enabled` definition."""
with spow_enable(True):
assert is_spow_enabled()
with spow_enable(False):
assert not is_spow_enabled() | Test :func:`colour.algebra.common.is_spow_enabled` definition. | test_is_spow_enabled | python | colour-science/colour | colour/algebra/tests/test_common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_common.py | BSD-3-Clause |
def test_set_spow_enable(self) -> None:
"""Test :func:`colour.algebra.common.set_spow_enable` definition."""
with spow_enable(is_spow_enabled()):
set_spow_enable(True)
assert is_spow_enabled()
with spow_enable(is_spow_enabled()):
set_spow_enable(False)
... | Test :func:`colour.algebra.common.set_spow_enable` definition. | test_set_spow_enable | python | colour-science/colour | colour/algebra/tests/test_common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_common.py | BSD-3-Clause |
def test_spow_enable(self) -> None:
"""Test :func:`colour.algebra.common.spow_enable` definition."""
with spow_enable(True):
assert is_spow_enabled()
with spow_enable(False):
assert not is_spow_enabled()
@spow_enable(True)
def fn_a() -> None:
... | Test :func:`colour.algebra.common.spow_enable` definition. | test_spow_enable | python | colour-science/colour | colour/algebra/tests/test_common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_common.py | BSD-3-Clause |
def test_spow(self) -> None:
"""Test :func:`colour.algebra.common.spow` definition."""
assert spow(2, 2) == 4.0
assert spow(-2, 2) == -4.0
np.testing.assert_allclose(
spow([2, -2, -2, 0], [2, 2, 0.15, 0]),
np.array([4.00000000, -4.00000000, -1.10956947, 0.00000... | Test :func:`colour.algebra.common.spow` definition. | test_spow | python | colour-science/colour | colour/algebra/tests/test_common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_common.py | BSD-3-Clause |
def test_normalise_vector(self) -> None:
"""Test :func:`colour.algebra.common.normalise_vector` definition."""
np.testing.assert_allclose(
normalise_vector(np.array([0.20654008, 0.12197225, 0.05136952])),
np.array([0.84197033, 0.49722560, 0.20941026]),
atol=TOLERANCE... | Test :func:`colour.algebra.common.normalise_vector` definition. | test_normalise_vector | python | colour-science/colour | colour/algebra/tests/test_common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_common.py | BSD-3-Clause |
def test_normalise_maximum(self) -> None:
"""Test :func:`colour.algebra.common.normalise_maximum` definition."""
np.testing.assert_allclose(
normalise_maximum(np.array([0.20654008, 0.12197225, 0.05136952])),
np.array([1.00000000, 0.59055003, 0.24871454]),
atol=TOLERA... | Test :func:`colour.algebra.common.normalise_maximum` definition. | test_normalise_maximum | python | colour-science/colour | colour/algebra/tests/test_common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_common.py | BSD-3-Clause |
def test_vecmul(self) -> None:
"""Test :func:`colour.algebra.common.vecmul` definition."""
m = np.array(
[
[0.7328, 0.4296, -0.1624],
[-0.7036, 1.6975, 0.0061],
[0.0030, 0.0136, 0.9834],
]
)
m = np.reshape(np.tile(m... | Test :func:`colour.algebra.common.vecmul` definition. | test_vecmul | python | colour-science/colour | colour/algebra/tests/test_common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_common.py | BSD-3-Clause |
def test_euclidean_distance(self) -> None:
"""Test :func:`colour.algebra.common.euclidean_distance` definition."""
np.testing.assert_allclose(
euclidean_distance(
np.array([100.00000000, 21.57210357, 272.22819350]),
np.array([100.00000000, 426.67945353, 72.39... | Test :func:`colour.algebra.common.euclidean_distance` definition. | test_euclidean_distance | python | colour-science/colour | colour/algebra/tests/test_common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_common.py | BSD-3-Clause |
def test_n_dimensional_euclidean_distance(self) -> None:
"""
Test :func:`colour.algebra.common.euclidean_distance` definition
n-dimensional arrays support.
"""
a = np.array([100.00000000, 21.57210357, 272.22819350])
b = np.array([100.00000000, 426.67945353, 72.39590835])... |
Test :func:`colour.algebra.common.euclidean_distance` definition
n-dimensional arrays support.
| test_n_dimensional_euclidean_distance | python | colour-science/colour | colour/algebra/tests/test_common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_common.py | BSD-3-Clause |
def test_nan_euclidean_distance(self) -> None:
"""
Test :func:`colour.algebra.common.euclidean_distance` 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))))
euclidean_distance(cases, ... |
Test :func:`colour.algebra.common.euclidean_distance` definition nan
support.
| test_nan_euclidean_distance | python | colour-science/colour | colour/algebra/tests/test_common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_common.py | BSD-3-Clause |
def test_manhattan_distance(self) -> None:
"""Test :func:`colour.algebra.common.manhattan_distance` definition."""
np.testing.assert_allclose(
manhattan_distance(
np.array([100.00000000, 21.57210357, 272.22819350]),
np.array([100.00000000, 426.67945353, 72.39... | Test :func:`colour.algebra.common.manhattan_distance` definition. | test_manhattan_distance | python | colour-science/colour | colour/algebra/tests/test_common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_common.py | BSD-3-Clause |
def test_n_dimensional_manhattan_distance(self) -> None:
"""
Test :func:`colour.algebra.common.manhattan_distance` definition
n-dimensional arrays support.
"""
a = np.array([100.00000000, 21.57210357, 272.22819350])
b = np.array([100.00000000, 426.67945353, 72.39590835])... |
Test :func:`colour.algebra.common.manhattan_distance` definition
n-dimensional arrays support.
| test_n_dimensional_manhattan_distance | python | colour-science/colour | colour/algebra/tests/test_common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_common.py | BSD-3-Clause |
def test_nan_manhattan_distance(self) -> None:
"""
Test :func:`colour.algebra.common.manhattan_distance` 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))))
manhattan_distance(cases, ... |
Test :func:`colour.algebra.common.manhattan_distance` definition nan
support.
| test_nan_manhattan_distance | python | colour-science/colour | colour/algebra/tests/test_common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_common.py | BSD-3-Clause |
def test_linear_conversion(self) -> None:
"""Test :func:`colour.algebra.common.linear_conversion` definition."""
np.testing.assert_allclose(
linear_conversion(
np.linspace(0, 1, 10), np.array([0, 1]), np.array([1, np.pi])
),
np.array(
... | Test :func:`colour.algebra.common.linear_conversion` definition. | test_linear_conversion | python | colour-science/colour | colour/algebra/tests/test_common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_common.py | BSD-3-Clause |
def test_linstep_function(self) -> None:
"""Test :func:`colour.algebra.common.linstep_function` definition."""
np.testing.assert_allclose(
linstep_function(
np.linspace(0, 1, 10),
np.linspace(0, 1, 10),
np.linspace(0, 2, 10),
),
... | Test :func:`colour.algebra.common.linstep_function` definition. | test_linstep_function | python | colour-science/colour | colour/algebra/tests/test_common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_common.py | BSD-3-Clause |
def test_smoothstep_function(self) -> None:
"""Test :func:`colour.algebra.common.smoothstep_function` definition."""
assert smoothstep_function(0.5) == 0.5
assert smoothstep_function(0.25) == 0.15625
assert smoothstep_function(0.75) == 0.84375
x = np.linspace(-2, 2, 5)
... | Test :func:`colour.algebra.common.smoothstep_function` definition. | test_smoothstep_function | python | colour-science/colour | colour/algebra/tests/test_common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_common.py | BSD-3-Clause |
def test_is_identity(self) -> None:
"""Test :func:`colour.algebra.common.is_identity` definition."""
assert is_identity(np.reshape(np.array([1, 0, 0, 0, 1, 0, 0, 0, 1]), (3, 3)))
assert not is_identity(
np.reshape(np.array([1, 2, 0, 0, 1, 0, 0, 0, 1]), (3, 3))
)
as... | Test :func:`colour.algebra.common.is_identity` definition. | test_is_identity | python | colour-science/colour | colour/algebra/tests/test_common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_common.py | BSD-3-Clause |
def test_is_identity(self) -> None:
"""Test :func:`colour.algebra.common.eigen_decomposition` definition."""
a = np.diag([1, 2, 3])
w, v = eigen_decomposition(a)
np.testing.assert_equal(w, np.array([3.0, 2.0, 1.0]))
np.testing.assert_equal(
v, np.array([[0.0, 0.0, 1... | Test :func:`colour.algebra.common.eigen_decomposition` definition. | test_is_identity | python | colour-science/colour | colour/algebra/tests/test_common.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_common.py | BSD-3-Clause |
def test_required_attributes(self) -> None:
"""Test the presence of required attributes."""
required_attributes = ("interpolator",)
for attribute in required_attributes:
assert attribute in dir(Extrapolator) | Test the presence of required attributes. | test_required_attributes | python | colour-science/colour | colour/algebra/tests/test_extrapolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_extrapolation.py | BSD-3-Clause |
def test_required_methods(self) -> None:
"""Test the presence of required methods."""
required_methods = ("__init__",)
for method in required_methods: # pragma: no cover
assert method in dir(Extrapolator) | Test the presence of required methods. | test_required_methods | python | colour-science/colour | colour/algebra/tests/test_extrapolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_extrapolation.py | BSD-3-Clause |
def test_interpolator(self) -> None:
"""
Test :attr:`colour.algebra.extrapolation.Extrapolator.interpolator`
property.
"""
extrapolator = Extrapolator(
LinearInterpolator(np.array([5, 6, 7]), np.array([5, 6, 7]))
)
assert isinstance(extrapolator.inter... |
Test :attr:`colour.algebra.extrapolation.Extrapolator.interpolator`
property.
| test_interpolator | python | colour-science/colour | colour/algebra/tests/test_extrapolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_extrapolation.py | BSD-3-Clause |
def test_method(self) -> None:
"""
Test :attr:`colour.algebra.extrapolation.Extrapolator.method`
property.
"""
extrapolator = Extrapolator(
LinearInterpolator(np.array([5, 6, 7]), np.array([5, 6, 7]))
)
assert extrapolator.method == "linear"
... |
Test :attr:`colour.algebra.extrapolation.Extrapolator.method`
property.
| test_method | python | colour-science/colour | colour/algebra/tests/test_extrapolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_extrapolation.py | BSD-3-Clause |
def test_left(self) -> None:
"""
Test :attr:`colour.algebra.extrapolation.Extrapolator.left`
property.
"""
extrapolator = Extrapolator(
LinearInterpolator(np.array([5, 6, 7]), np.array([5, 6, 7])),
left=0,
)
assert extrapolator.left == 0 |
Test :attr:`colour.algebra.extrapolation.Extrapolator.left`
property.
| test_left | python | colour-science/colour | colour/algebra/tests/test_extrapolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_extrapolation.py | BSD-3-Clause |
def test_right(self) -> None:
"""
Test :attr:`colour.algebra.extrapolation.Extrapolator.right`
property.
"""
extrapolator = Extrapolator(
LinearInterpolator(np.array([5, 6, 7]), np.array([5, 6, 7])),
right=0,
)
assert extrapolator.right ==... |
Test :attr:`colour.algebra.extrapolation.Extrapolator.right`
property.
| test_right | python | colour-science/colour | colour/algebra/tests/test_extrapolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_extrapolation.py | BSD-3-Clause |
def test__call__(self) -> None:
"""
Test :meth:`colour.algebra.extrapolation.Extrapolator.__call__`
method.
"""
extrapolator = Extrapolator(
LinearInterpolator(np.array([5, 6, 7]), np.array([5, 6, 7]))
)
np.testing.assert_array_equal(extrapolator((4, ... |
Test :meth:`colour.algebra.extrapolation.Extrapolator.__call__`
method.
| test__call__ | python | colour-science/colour | colour/algebra/tests/test_extrapolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_extrapolation.py | BSD-3-Clause |
def test_nan__call__(self) -> None:
"""
Test :method:`colour.algebra.extrapolation.Extrapolator.__call__`
method nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
for case in cases:
... |
Test :method:`colour.algebra.extrapolation.Extrapolator.__call__`
method nan support.
| test_nan__call__ | python | colour-science/colour | colour/algebra/tests/test_extrapolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_extrapolation.py | BSD-3-Clause |
def test_kernel_nearest(self) -> None:
"""
Test :func:`colour.algebra.interpolation.kernel_nearest_neighbour`
definition.
"""
np.testing.assert_allclose(
kernel_nearest_neighbour(np.linspace(-5, 5, 25)),
np.array(
[
0,
... |
Test :func:`colour.algebra.interpolation.kernel_nearest_neighbour`
definition.
| test_kernel_nearest | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_kernel_linear(self) -> None:
"""Test :func:`colour.algebra.interpolation.kernel_linear` definition."""
np.testing.assert_allclose(
kernel_linear(np.linspace(-5, 5, 25)),
np.array(
[
0.00000000,
0.00000000,
... | Test :func:`colour.algebra.interpolation.kernel_linear` definition. | test_kernel_linear | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_kernel_sinc(self) -> None:
"""Test :func:`colour.algebra.interpolation.kernel_sinc` definition."""
np.testing.assert_allclose(
kernel_sinc(np.linspace(-5, 5, 25)),
np.array(
[
0.00000000,
0.00000000,
... | Test :func:`colour.algebra.interpolation.kernel_sinc` definition. | test_kernel_sinc | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_kernel_lanczos(self) -> None:
"""Test :func:`colour.algebra.interpolation.kernel_lanczos` definition."""
np.testing.assert_allclose(
kernel_lanczos(np.linspace(-5, 5, 25)),
np.array(
[
0.00000000e00,
0.00000000e00,... | Test :func:`colour.algebra.interpolation.kernel_lanczos` definition. | test_kernel_lanczos | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_kernel_cardinal_spline(self) -> None:
"""
Test :func:`colour.algebra.interpolation.kernel_cardinal_spline`
definition.
"""
np.testing.assert_allclose(
kernel_cardinal_spline(np.linspace(-5, 5, 25)),
np.array(
[
... |
Test :func:`colour.algebra.interpolation.kernel_cardinal_spline`
definition.
| test_kernel_cardinal_spline | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_x(self) -> None:
"""
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) |
Test :attr:`colour.algebra.interpolation.KernelInterpolator.x`
property.
| test_x | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_y(self) -> None:
"""
Test :attr:`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) |
Test :attr:`colour.algebra.interpolation.KernelInterpolator.y`
property.
| test_y | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_window(self) -> None:
"""
Test :attr:`colour.algebra.interpolation.KernelInterpolator.window`
property.
"""
x = y = np.linspace(0, 1, 10)
kernel_interpolator = KernelInterpolator(x, y, window=3)
assert kernel_interpolator.window == 3 |
Test :attr:`colour.algebra.interpolation.KernelInterpolator.window`
property.
| test_window | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_kernel(self) -> None:
"""
Test :attr:`colour.algebra.interpolation.KernelInterpolator.kernel`
property.
"""
x = y = np.linspace(0, 1, 10)
kernel_interpolator = KernelInterpolator(x, y, kernel=kernel_linear)
assert kernel_interpolator.kernel is kernel_li... |
Test :attr:`colour.algebra.interpolation.KernelInterpolator.kernel`
property.
| test_kernel | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_kernel_kwargs(self) -> None:
"""
Test :attr:`colour.algebra.interpolation.KernelInterpolator.\
kernel_kwargs` property.
"""
x = y = np.linspace(0, 1, 10)
kernel_kwargs = {"a": 1}
kernel_interpolator = KernelInterpolator(x, y, kernel_kwargs=kernel_kwargs)
... |
Test :attr:`colour.algebra.interpolation.KernelInterpolator.kernel_kwargs` property.
| test_kernel_kwargs | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_padding_kwargs(self) -> None:
"""
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, padd... |
Test :attr:`colour.algebra.interpolation.KernelInterpolator.padding_kwargs` property.
| test_padding_kwargs | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_raise_exception___init__(self) -> None:
"""
Test :meth:`colour.algebra.interpolation.KernelInterpolator.__init__`
method raised exception.
"""
pytest.raises(
ValueError,
KernelInterpolator,
np.linspace(0, 1, 10),
np.linspa... |
Test :meth:`colour.algebra.interpolation.KernelInterpolator.__init__`
method raised exception.
| test_raise_exception___init__ | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test__call__(self) -> None:
"""
Test :meth:`colour.algebra.interpolation.KernelInterpolator.__call__`
method.
"""
x = np.arange(11, 26, 1)
y = np.sin(x / len(x) * np.pi * 6) / (x / len(x)) + np.pi
x_i = np.linspace(11, 25, 25)
kernel_interpolator = K... |
Test :meth:`colour.algebra.interpolation.KernelInterpolator.__call__`
method.
| test__call__ | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_raise_exception___call__(self) -> None:
"""
Test :meth:`colour.algebra.interpolation.KernelInterpolator.__call__`
method raised exception.
"""
x = y = np.linspace(0, 1, 10)
kernel_interpolator = KernelInterpolator(x, y)
pytest.raises(ValueError, kernel_... |
Test :meth:`colour.algebra.interpolation.KernelInterpolator.__call__`
method raised exception.
| test_raise_exception___call__ | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_nan__call__(self) -> None:
"""
Test :meth:`colour.algebra.interpolation.KernelInterpolator.__call__`
method nan support.
"""
# NOTE: As the "x" independent variable must be uniform, it cannot
# contain NaNs.
# TODO: Revisit if the interpolator can be app... |
Test :meth:`colour.algebra.interpolation.KernelInterpolator.__call__`
method nan support.
| test_nan__call__ | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test___init__(self) -> None:
"""
Test :meth:`colour.algebra.interpolation.KernelInterpolator.__init__`
method.
"""
x = y = np.linspace(0, 1, 10)
nearest_neighbour_interpolator = NearestNeighbourInterpolator(
x, y, kernel_kwargs={"a": 1}
)
... |
Test :meth:`colour.algebra.interpolation.KernelInterpolator.__init__`
method.
| test___init__ | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_raise_exception___init__(self) -> None:
"""
Test :meth:`colour.algebra.interpolation.LinearInterpolator.__init__`
method raised exception.
"""
x, y = np.linspace(0, 1, 10), np.linspace(0, 1, 15)
pytest.raises(ValueError, LinearInterpolator, x, y) |
Test :meth:`colour.algebra.interpolation.LinearInterpolator.__init__`
method raised exception.
| test_raise_exception___init__ | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test__call__(self) -> None:
"""
Test :meth:`colour.algebra.interpolation.LinearInterpolator.__call__`
method.
"""
interval = 0.1
x = np.arange(len(DATA_POINTS_A))
linear_interpolator = LinearInterpolator(x, DATA_POINTS_A)
for i, value in enumerate(
... |
Test :meth:`colour.algebra.interpolation.LinearInterpolator.__call__`
method.
| test__call__ | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_raise_exception___call__(self) -> None:
"""
Test :meth:`colour.algebra.interpolation.LinearInterpolator.__call__`
method raised exception.
"""
x = y = np.linspace(0, 1, 10)
linear_interpolator = LinearInterpolator(x, y)
pytest.raises(ValueError, linear_... |
Test :meth:`colour.algebra.interpolation.LinearInterpolator.__call__`
method raised exception.
| test_raise_exception___call__ | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_nan__call__(self) -> None:
"""
Test :meth:`colour.algebra.interpolation.LinearInterpolator.__call__`
method nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
for case in cases:
... |
Test :meth:`colour.algebra.interpolation.LinearInterpolator.__call__`
method nan support.
| test_nan__call__ | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_raise_exception___init__(self) -> None:
"""
Test :meth:`colour.algebra.interpolation.SpragueInterpolator.__init__`
method raised exception.
"""
x, y = np.linspace(0, 1, 10), np.linspace(0, 1, 15)
pytest.raises(ValueError, SpragueInterpolator, x, y) |
Test :meth:`colour.algebra.interpolation.SpragueInterpolator.__init__`
method raised exception.
| test_raise_exception___init__ | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test__call__(self) -> None:
"""
Test :meth:`colour.algebra.interpolation.SpragueInterpolator.__call__`
method.
"""
interval = 0.1
x = np.arange(len(DATA_POINTS_A))
sprague_interpolator = SpragueInterpolator(x, DATA_POINTS_A)
for i, value in enumerate... |
Test :meth:`colour.algebra.interpolation.SpragueInterpolator.__call__`
method.
| test__call__ | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_raise_exception___call__(self) -> None:
"""
Test :meth:`colour.algebra.interpolation.SpragueInterpolator.__call__`
method raised exception.
"""
x = y = np.linspace(0, 1, 10)
sprague_interpolator = SpragueInterpolator(x, y)
pytest.raises(ValueError, spra... |
Test :meth:`colour.algebra.interpolation.SpragueInterpolator.__call__`
method raised exception.
| test_raise_exception___call__ | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_nan__call__(self) -> None:
"""
Test :meth:`colour.algebra.interpolation.SpragueInterpolator.__call__`
method nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
for case in cases:
... |
Test :meth:`colour.algebra.interpolation.SpragueInterpolator.__call__`
method nan support.
| test_nan__call__ | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test__call__(self) -> None:
"""
Test :meth:`colour.algebra.interpolation.CubicSplineInterpolator.\
__call__` method.
Notes
-----
- This class is a wrapper around *scipy.interpolate.interp1d* class
and is assumed to be unit tested thoroughly.
"""
... |
Test :meth:`colour.algebra.interpolation.CubicSplineInterpolator.__call__` method.
Notes
-----
- This class is a wrapper around *scipy.interpolate.interp1d* class
and is assumed to be unit tested thoroughly.
| test__call__ | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_y(self) -> None:
"""
Test :attr:`colour.algebra.interpolation.PchipInterpolator.y` property.
"""
interpolator = PchipInterpolator(np.linspace(0, 1, 10), np.linspace(0, 1, 10))
interpolator.y = np.linspace(0, 1, 10)
assert interpolator(np.array(5)) == 5 |
Test :attr:`colour.algebra.interpolation.PchipInterpolator.y` property.
| test_y | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_x(self) -> None:
"""
Test :attr:`colour.algebra.interpolation.NullInterpolator.x`
property.
"""
x = y = np.linspace(0, 1, 10)
null_interpolator = NullInterpolator(x, y)
np.testing.assert_equal(null_interpolator.x, x) |
Test :attr:`colour.algebra.interpolation.NullInterpolator.x`
property.
| test_x | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_y(self) -> None:
"""
Test :attr:`colour.algebra.interpolation.NullInterpolator.y`
property.
"""
x = y = np.linspace(0, 1, 10)
null_interpolator = NullInterpolator(x, y)
np.testing.assert_equal(null_interpolator.y, y) |
Test :attr:`colour.algebra.interpolation.NullInterpolator.y`
property.
| test_y | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_absolute_tolerance(self) -> None:
"""
Test :attr:`colour.algebra.interpolation.NullInterpolator.\
absolute_tolerance` property.
"""
x = y = np.linspace(0, 1, 10)
null_interpolator = NullInterpolator(x, y, absolute_tolerance=0.1)
np.testing.assert_equal(null_int... |
Test :attr:`colour.algebra.interpolation.NullInterpolator.absolute_tolerance` property.
| test_absolute_tolerance | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_relative_tolerance(self) -> None:
"""
Test :attr:`colour.algebra.interpolation.NullInterpolator.\
relative_tolerance` property.
"""
x = y = np.linspace(0, 1, 10)
null_interpolator = NullInterpolator(x, y, relative_tolerance=0.1)
np.testing.assert_equal(null_int... |
Test :attr:`colour.algebra.interpolation.NullInterpolator.relative_tolerance` property.
| test_relative_tolerance | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_default(self) -> None:
"""
Test :attr:`colour.algebra.interpolation.NullInterpolator.\
default` property.
"""
x = y = np.linspace(0, 1, 10)
null_interpolator = NullInterpolator(x, y, default=0)
np.testing.assert_equal(null_interpolator.default, 0) |
Test :attr:`colour.algebra.interpolation.NullInterpolator.default` property.
| test_default | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_raise_exception___init__(self) -> None:
"""
Test :meth:`colour.algebra.interpolation.NullInterpolator.__init__`
method raised exception.
"""
x, y = np.linspace(0, 1, 10), np.linspace(0, 1, 15)
pytest.raises(ValueError, NullInterpolator, x, y) |
Test :meth:`colour.algebra.interpolation.NullInterpolator.__init__`
method raised exception.
| test_raise_exception___init__ | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test__call__(self) -> None:
"""
Test :meth:`colour.algebra.interpolation.NullInterpolator.__call__`
method.
"""
x = np.arange(len(DATA_POINTS_A))
null_interpolator = NullInterpolator(x, DATA_POINTS_A)
np.testing.assert_allclose(
null_interpolator(... |
Test :meth:`colour.algebra.interpolation.NullInterpolator.__call__`
method.
| test__call__ | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_raise_exception___call__(self) -> None:
"""
Test :meth:`colour.algebra.interpolation.NullInterpolator.__call__`
method raised exception.
"""
x = y = np.linspace(0, 1, 10)
null_interpolator = NullInterpolator(x, y)
pytest.raises(ValueError, null_interpol... |
Test :meth:`colour.algebra.interpolation.NullInterpolator.__call__`
method raised exception.
| test_raise_exception___call__ | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_nan__call__(self) -> None:
"""
Test :meth:`colour.algebra.interpolation.NullInterpolator.__call__`
method nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
for case in cases:
... |
Test :meth:`colour.algebra.interpolation.NullInterpolator.__call__`
method nan support.
| test_nan__call__ | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_lagrange_coefficients(self) -> None:
"""
Test :func:`colour.algebra.interpolation.lagrange_coefficients`
definition.
Notes
-----
- :attr:`LAGRANGE_COEFFICIENTS_A` and :attr:`LAGRANGE_COEFFICIENTS_B`
attributes data is matching :cite:`Fairman1985b`.... |
Test :func:`colour.algebra.interpolation.lagrange_coefficients`
definition.
Notes
-----
- :attr:`LAGRANGE_COEFFICIENTS_A` and :attr:`LAGRANGE_COEFFICIENTS_B`
attributes data is matching :cite:`Fairman1985b`.
References
----------
:cite:`Fa... | test_lagrange_coefficients | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_vertices_and_relative_coordinates(self) -> None:
"""
Test :func:`colour.algebra.interpolation.\
vertices_and_relative_coordinates` definition.
"""
prng = np.random.RandomState(4)
V_xyz = random_triplet_generator(4, random_state=prng)
vertices, V_xyzr = vertices... |
Test :func:`colour.algebra.interpolation.vertices_and_relative_coordinates` definition.
| test_vertices_and_relative_coordinates | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_interpolation_trilinear(self) -> None:
"""
Test :func:`colour.algebra.interpolation.\
table_interpolation_trilinear` definition.
"""
prng = np.random.RandomState(4)
V_xyz = random_triplet_generator(16, random_state=prng)
np.testing.assert_allclose(
... |
Test :func:`colour.algebra.interpolation.table_interpolation_trilinear` definition.
| test_interpolation_trilinear | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_interpolation_tetrahedral(self) -> None:
"""
Test :func:`colour.algebra.interpolation.\
table_interpolation_tetrahedral` definition.
"""
prng = np.random.RandomState(4)
V_xyz = random_triplet_generator(16, random_state=prng)
np.testing.assert_allclose(
... |
Test :func:`colour.algebra.interpolation.table_interpolation_tetrahedral` definition.
| test_interpolation_tetrahedral | python | colour-science/colour | colour/algebra/tests/test_interpolation.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_interpolation.py | BSD-3-Clause |
def test_random_triplet_generator(self) -> None:
"""
Test :func:`colour.algebra.prng.random_triplet_generator` definition.
Notes
-----
- The test is assuming that :func:`np.random.RandomState` definition
will return the same sequence no matter which *OS* or *Python... |
Test :func:`colour.algebra.prng.random_triplet_generator` definition.
Notes
-----
- The test is assuming that :func:`np.random.RandomState` definition
will return the same sequence no matter which *OS* or *Python*
version is used. There is however no formal pr... | test_random_triplet_generator | python | colour-science/colour | colour/algebra/tests/test_prng.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_prng.py | BSD-3-Clause |
def test_least_square_mapping_MoorePenrose(self) -> None:
"""
Test :func:`colour.algebra.regression.\
least_square_mapping_MoorePenrose` definition.
"""
prng = np.random.RandomState(2)
y = prng.random_sample((24, 3))
x = y + (prng.random_sample((24, 3)) - 0.5) * 0.5
... |
Test :func:`colour.algebra.regression.least_square_mapping_MoorePenrose` definition.
| test_least_square_mapping_MoorePenrose | python | colour-science/colour | colour/algebra/tests/test_regression.py | https://github.com/colour-science/colour/blob/master/colour/algebra/tests/test_regression.py | BSD-3-Clause |
def XYZ_to_ATD95(
XYZ: ArrayLike,
XYZ_0: ArrayLike,
Y_0: ArrayLike,
k_1: ArrayLike,
k_2: ArrayLike,
sigma: ArrayLike = 300,
) -> CAM_Specification_ATD95:
"""
Compute the *ATD (1995)* colour vision model correlates.
Parameters
----------
XYZ
*CIE XYZ* tristimulus valu... |
Compute the *ATD (1995)* colour vision model correlates.
Parameters
----------
XYZ
*CIE XYZ* tristimulus values of test sample / stimulus.
XYZ_0
*CIE XYZ* tristimulus values of reference white.
Y_0
Absolute adapting field luminance in :math:`cd/m^2`.
k_1
App... | XYZ_to_ATD95 | python | colour-science/colour | colour/appearance/atd95.py | https://github.com/colour-science/colour/blob/master/colour/appearance/atd95.py | BSD-3-Clause |
def luminance_to_retinal_illuminance(XYZ: ArrayLike, Y_c: ArrayLike) -> NDArrayFloat:
"""
Convert luminance in :math:`cd/m^2` to retinal illuminance in trolands.
Parameters
----------
XYZ
*CIE XYZ* tristimulus values.
Y_c
Absolute adapting field luminance in :math:`cd/m^2`.
... |
Convert luminance in :math:`cd/m^2` to retinal illuminance in trolands.
Parameters
----------
XYZ
*CIE XYZ* tristimulus values.
Y_c
Absolute adapting field luminance in :math:`cd/m^2`.
Returns
-------
:class:`numpy.ndarray`
Converted *CIE XYZ* tristimulus value... | luminance_to_retinal_illuminance | python | colour-science/colour | colour/appearance/atd95.py | https://github.com/colour-science/colour/blob/master/colour/appearance/atd95.py | BSD-3-Clause |
def XYZ_to_LMS_ATD95(XYZ: ArrayLike) -> NDArrayFloat:
"""
Convert *CIE XYZ* tristimulus values to *LMS* cone responses.
Parameters
----------
XYZ
*CIE XYZ* tristimulus values.
Returns
-------
:class:`numpy.ndarray`
*LMS* cone responses.
Examples
--------
>>... |
Convert *CIE XYZ* tristimulus values to *LMS* cone responses.
Parameters
----------
XYZ
*CIE XYZ* tristimulus values.
Returns
-------
:class:`numpy.ndarray`
*LMS* cone responses.
Examples
--------
>>> XYZ = np.array([19.01, 20.00, 21.78])
>>> XYZ_to_LMS_AT... | XYZ_to_LMS_ATD95 | python | colour-science/colour | colour/appearance/atd95.py | https://github.com/colour-science/colour/blob/master/colour/appearance/atd95.py | BSD-3-Clause |
def opponent_colour_dimensions(LMS_g: ArrayLike) -> NDArrayFloat:
"""
Compute opponent colour dimensions from the specified post-adaptation cone
signals.
Parameters
----------
LMS_g
Post-adaptation cone signals.
Returns
-------
:class:`numpy.ndarray`
Opponent colour... |
Compute opponent colour dimensions from the specified post-adaptation cone
signals.
Parameters
----------
LMS_g
Post-adaptation cone signals.
Returns
-------
:class:`numpy.ndarray`
Opponent colour dimensions.
Examples
--------
>>> LMS_g = np.array([6.95457... | opponent_colour_dimensions | python | colour-science/colour | colour/appearance/atd95.py | https://github.com/colour-science/colour/blob/master/colour/appearance/atd95.py | BSD-3-Clause |
def final_response(value: ArrayLike) -> NDArrayFloat:
"""
Compute the final response of the specified opponent colour dimension.
Parameters
----------
value
Opponent colour dimension.
Returns
-------
:class:`numpy.ndarray`
Final response of opponent colour dimension.
... |
Compute the final response of the specified opponent colour dimension.
Parameters
----------
value
Opponent colour dimension.
Returns
-------
:class:`numpy.ndarray`
Final response of opponent colour dimension.
Examples
--------
>>> final_response(43.5439969550... | final_response | python | colour-science/colour | colour/appearance/atd95.py | https://github.com/colour-science/colour/blob/master/colour/appearance/atd95.py | BSD-3-Clause |
def XYZ_to_CAM16(
XYZ: ArrayLike,
XYZ_w: ArrayLike,
L_A: ArrayLike,
Y_b: ArrayLike,
surround: (
InductionFactors_CIECAM02 | InductionFactors_CAM16
) = VIEWING_CONDITIONS_CAM16["Average"],
discount_illuminant: bool = False,
compute_H: bool = True,
) -> CAM_Specification_CAM16:
... |
Compute the *CAM16* colour appearance model correlates from the specified
*CIE XYZ* tristimulus values.
Parameters
----------
XYZ
*CIE XYZ* tristimulus values of test sample / stimulus.
XYZ_w
*CIE XYZ* tristimulus values of reference white.
L_A
Adapting field *lumin... | XYZ_to_CAM16 | python | colour-science/colour | colour/appearance/cam16.py | https://github.com/colour-science/colour/blob/master/colour/appearance/cam16.py | BSD-3-Clause |
def CAM16_to_XYZ(
specification: CAM_Specification_CAM16,
XYZ_w: ArrayLike,
L_A: ArrayLike,
Y_b: ArrayLike,
surround: (
InductionFactors_CIECAM02 | InductionFactors_CAM16
) = VIEWING_CONDITIONS_CAM16["Average"],
discount_illuminant: bool = False,
) -> NDArrayFloat:
"""
Conver... |
Convert *CAM16* specification to *CIE XYZ* tristimulus values.
Parameters
----------
specification
*CAM16* colour appearance model specification. Correlate of
*lightness* :math:`J`, correlate of *chroma* :math:`C` or correlate
of *colourfulness* :math:`M` and *hue* angle :math:... | CAM16_to_XYZ | python | colour-science/colour | colour/appearance/cam16.py | https://github.com/colour-science/colour/blob/master/colour/appearance/cam16.py | BSD-3-Clause |
def XYZ_to_CIECAM02(
XYZ: ArrayLike,
XYZ_w: ArrayLike,
L_A: ArrayLike,
Y_b: ArrayLike,
surround: InductionFactors_CIECAM02 = VIEWING_CONDITIONS_CIECAM02["Average"],
discount_illuminant: bool = False,
compute_H: bool = True,
) -> CAM_Specification_CIECAM02:
"""
Compute the *CIECAM02* ... |
Compute the *CIECAM02* colour appearance model correlates from the specified
*CIE XYZ* tristimulus values.
Parameters
----------
XYZ
*CIE XYZ* tristimulus values of test sample / stimulus.
XYZ_w
*CIE XYZ* tristimulus values of reference white.
L_A
Adapting field *lu... | XYZ_to_CIECAM02 | python | colour-science/colour | colour/appearance/ciecam02.py | https://github.com/colour-science/colour/blob/master/colour/appearance/ciecam02.py | BSD-3-Clause |
def CIECAM02_to_XYZ(
specification: CAM_Specification_CIECAM02,
XYZ_w: ArrayLike,
L_A: ArrayLike,
Y_b: ArrayLike,
surround: InductionFactors_CIECAM02 = VIEWING_CONDITIONS_CIECAM02["Average"],
discount_illuminant: bool = False,
) -> NDArrayFloat:
"""
Convert *CIECAM02* specification to *C... |
Convert *CIECAM02* specification to *CIE XYZ* tristimulus values.
Parameters
----------
specification
*CIECAM02* colour appearance model specification. Correlate of
*Lightness* :math:`J`, correlate of *chroma* :math:`C` or correlate of
*colourfulness* :math:`M` and *hue* angle ... | CIECAM02_to_XYZ | python | colour-science/colour | colour/appearance/ciecam02.py | https://github.com/colour-science/colour/blob/master/colour/appearance/ciecam02.py | BSD-3-Clause |
def chromatic_induction_factors(n: ArrayLike) -> NDArrayFloat:
"""
Compute the chromatic induction factors :math:`N_{bb}` and
:math:`N_{cb}`.
Parameters
----------
n
Function of the luminance factor of the background :math:`n`.
Returns
-------
:class:`numpy.ndarray`
... |
Compute the chromatic induction factors :math:`N_{bb}` and
:math:`N_{cb}`.
Parameters
----------
n
Function of the luminance factor of the background :math:`n`.
Returns
-------
:class:`numpy.ndarray`
Chromatic induction factors :math:`N_{bb}` and :math:`N_{cb}`.
E... | chromatic_induction_factors | python | colour-science/colour | colour/appearance/ciecam02.py | https://github.com/colour-science/colour/blob/master/colour/appearance/ciecam02.py | BSD-3-Clause |
def base_exponential_non_linearity(
n: ArrayLike,
) -> NDArrayFloat:
"""
Compute the base exponential non-linearity :math:`n`.
Parameters
----------
n
Function of the luminance factor of the background :math:`n`.
Returns
-------
:class:`numpy.ndarray`
Base exponenti... |
Compute the base exponential non-linearity :math:`n`.
Parameters
----------
n
Function of the luminance factor of the background :math:`n`.
Returns
-------
:class:`numpy.ndarray`
Base exponential non-linearity :math:`z`.
Examples
--------
>>> base_exponential_... | base_exponential_non_linearity | python | colour-science/colour | colour/appearance/ciecam02.py | https://github.com/colour-science/colour/blob/master/colour/appearance/ciecam02.py | BSD-3-Clause |
def viewing_conditions_dependent_parameters(
Y_b: ArrayLike,
Y_w: ArrayLike,
L_A: ArrayLike,
) -> Tuple[
NDArrayFloat,
NDArrayFloat,
NDArrayFloat,
NDArrayFloat,
NDArrayFloat,
]:
"""
Compute the viewing condition dependent parameters.
Parameters
----------
Y_b
... |
Compute the viewing condition dependent parameters.
Parameters
----------
Y_b
Adapting field *Y* tristimulus value :math:`Y_b`.
Y_w
Whitepoint *Y* tristimulus value :math:`Y_w`.
L_A
Adapting field *luminance* :math:`L_A` in :math:`cd/m^2`.
Returns
-------
:... | viewing_conditions_dependent_parameters | python | colour-science/colour | colour/appearance/ciecam02.py | https://github.com/colour-science/colour/blob/master/colour/appearance/ciecam02.py | BSD-3-Clause |
def degree_of_adaptation(F: ArrayLike, L_A: ArrayLike) -> NDArrayFloat:
"""
Compute the degree of adaptation :math:`D` from the specified surround
maximum degree of adaptation :math:`F` and adapting field *luminance*
:math:`L_A` in :math:`cd/m^2`.
Parameters
----------
F
Surround ma... |
Compute the degree of adaptation :math:`D` from the specified surround
maximum degree of adaptation :math:`F` and adapting field *luminance*
:math:`L_A` in :math:`cd/m^2`.
Parameters
----------
F
Surround maximum degree of adaptation :math:`F`.
L_A
Adapting field *luminance... | degree_of_adaptation | python | colour-science/colour | colour/appearance/ciecam02.py | https://github.com/colour-science/colour/blob/master/colour/appearance/ciecam02.py | BSD-3-Clause |
def full_chromatic_adaptation_forward(
RGB: ArrayLike,
RGB_w: ArrayLike,
Y_w: ArrayLike,
D: ArrayLike,
) -> NDArrayFloat:
"""
Apply full chromatic adaptation to specified *CMCCAT2000* transform sharpened
*RGB* array using specified *CMCCAT2000* transform sharpened whitepoint
*RGB_w* arra... |
Apply full chromatic adaptation to specified *CMCCAT2000* transform sharpened
*RGB* array using specified *CMCCAT2000* transform sharpened whitepoint
*RGB_w* array.
Parameters
----------
RGB
*CMCCAT2000* transform sharpened *RGB* array.
RGB_w
*CMCCAT2000* transform sharpene... | full_chromatic_adaptation_forward | python | colour-science/colour | colour/appearance/ciecam02.py | https://github.com/colour-science/colour/blob/master/colour/appearance/ciecam02.py | BSD-3-Clause |
def full_chromatic_adaptation_inverse(
RGB: ArrayLike,
RGB_w: ArrayLike,
Y_w: ArrayLike,
D: ArrayLike,
) -> NDArrayFloat:
"""
Revert full chromatic adaptation of specified *CMCCAT2000* transform sharpened
*RGB* array using specified *CMCCAT2000* transform sharpened whitepoint
*RGB_w* arr... |
Revert full chromatic adaptation of specified *CMCCAT2000* transform sharpened
*RGB* array using specified *CMCCAT2000* transform sharpened whitepoint
*RGB_w* array.
Parameters
----------
RGB
*CMCCAT2000* transform sharpened *RGB* array.
RGB_w
*CMCCAT2000* transform sharpen... | full_chromatic_adaptation_inverse | python | colour-science/colour | colour/appearance/ciecam02.py | https://github.com/colour-science/colour/blob/master/colour/appearance/ciecam02.py | BSD-3-Clause |
def post_adaptation_non_linear_response_compression_forward(
RGB: ArrayLike, F_L: ArrayLike
) -> NDArrayFloat:
"""
Apply post adaptation non-linear response compression to the specified
*CMCCAT2000* transform sharpened *RGB* array.
Parameters
----------
RGB
*CMCCAT2000* transform sh... |
Apply post adaptation non-linear response compression to the specified
*CMCCAT2000* transform sharpened *RGB* array.
Parameters
----------
RGB
*CMCCAT2000* transform sharpened *RGB* array.
F_L
*Luminance* level adaptation factor :math:`F_L`.
Returns
-------
:class:... | post_adaptation_non_linear_response_compression_forward | python | colour-science/colour | colour/appearance/ciecam02.py | https://github.com/colour-science/colour/blob/master/colour/appearance/ciecam02.py | BSD-3-Clause |
def post_adaptation_non_linear_response_compression_inverse(
RGB: ArrayLike, F_L: ArrayLike
) -> NDArrayFloat:
"""
Remove post adaptation non-linear response compression from the specified
*CMCCAT2000* transform sharpened *RGB* array.
Parameters
----------
RGB
*CMCCAT2000* transform... |
Remove post adaptation non-linear response compression from the specified
*CMCCAT2000* transform sharpened *RGB* array.
Parameters
----------
RGB
*CMCCAT2000* transform sharpened *RGB* array.
F_L
*Luminance* level adaptation factor :math:`F_L`.
Returns
-------
:cla... | post_adaptation_non_linear_response_compression_inverse | python | colour-science/colour | colour/appearance/ciecam02.py | https://github.com/colour-science/colour/blob/master/colour/appearance/ciecam02.py | BSD-3-Clause |
def opponent_colour_dimensions_forward(RGB: ArrayLike) -> NDArrayFloat:
"""
Compute opponent colour dimensions from the specified compressed
*CMCCAT2000* transform sharpened *RGB* array for forward
*CIECAM02* implementation.
Parameters
----------
RGB
Compressed *CMCCAT2000* transfor... |
Compute opponent colour dimensions from the specified compressed
*CMCCAT2000* transform sharpened *RGB* array for forward
*CIECAM02* implementation.
Parameters
----------
RGB
Compressed *CMCCAT2000* transform sharpened *RGB* array.
Returns
-------
:class:`numpy.ndarray`
... | opponent_colour_dimensions_forward | python | colour-science/colour | colour/appearance/ciecam02.py | https://github.com/colour-science/colour/blob/master/colour/appearance/ciecam02.py | BSD-3-Clause |
def opponent_colour_dimensions_inverse(P_n: ArrayLike, h: ArrayLike) -> NDArrayFloat:
"""
Compute opponent colour dimensions from the specified points :math:`P_n`
and hue :math:`h` in degrees for inverse *CIECAM02* implementation.
Parameters
----------
P_n
Points :math:`P_n`.
h
... |
Compute opponent colour dimensions from the specified points :math:`P_n`
and hue :math:`h` in degrees for inverse *CIECAM02* implementation.
Parameters
----------
P_n
Points :math:`P_n`.
h
Hue :math:`h` in degrees.
Returns
-------
:class:`numpy.ndarray`
Opp... | opponent_colour_dimensions_inverse | python | colour-science/colour | colour/appearance/ciecam02.py | https://github.com/colour-science/colour/blob/master/colour/appearance/ciecam02.py | BSD-3-Clause |
def hue_angle(a: ArrayLike, b: ArrayLike) -> NDArrayFloat:
"""
Compute the *hue* angle :math:`h` in degrees.
Parameters
----------
a
Opponent colour dimension :math:`a`.
b
Opponent colour dimension :math:`b`.
Returns
-------
:class:`numpy.ndarray`
*Hue* angl... |
Compute the *hue* angle :math:`h` in degrees.
Parameters
----------
a
Opponent colour dimension :math:`a`.
b
Opponent colour dimension :math:`b`.
Returns
-------
:class:`numpy.ndarray`
*Hue* angle :math:`h` in degrees.
Examples
--------
>>> a = -0.... | hue_angle | python | colour-science/colour | colour/appearance/ciecam02.py | https://github.com/colour-science/colour/blob/master/colour/appearance/ciecam02.py | BSD-3-Clause |
def hue_quadrature(h: ArrayLike) -> NDArrayFloat:
"""
Compute the hue quadrature from the specified hue :math:`h` angle in
degrees.
Parameters
----------
h
Hue :math:`h` angle in degrees.
Returns
-------
:class:`numpy.ndarray`
Hue quadrature.
Examples
-----... |
Compute the hue quadrature from the specified hue :math:`h` angle in
degrees.
Parameters
----------
h
Hue :math:`h` angle in degrees.
Returns
-------
:class:`numpy.ndarray`
Hue quadrature.
Examples
--------
>>> hue_quadrature(219.0484326582719) # doctest:... | hue_quadrature | python | colour-science/colour | colour/appearance/ciecam02.py | https://github.com/colour-science/colour/blob/master/colour/appearance/ciecam02.py | BSD-3-Clause |
def eccentricity_factor(h: ArrayLike) -> NDArrayFloat:
"""
Compute the eccentricity factor :math:`e_t` from the specified hue
:math:`h` angle in degrees for forward *CIECAM02* implementation.
Parameters
----------
h
Hue :math:`h` angle in degrees.
Returns
-------
:class:`nu... |
Compute the eccentricity factor :math:`e_t` from the specified hue
:math:`h` angle in degrees for forward *CIECAM02* implementation.
Parameters
----------
h
Hue :math:`h` angle in degrees.
Returns
-------
:class:`numpy.ndarray`
Eccentricity factor :math:`e_t`.
Exa... | eccentricity_factor | python | colour-science/colour | colour/appearance/ciecam02.py | https://github.com/colour-science/colour/blob/master/colour/appearance/ciecam02.py | BSD-3-Clause |
def achromatic_response_forward(RGB: ArrayLike, N_bb: ArrayLike) -> NDArrayFloat:
"""
Compute the achromatic response :math:`A` from the specified compressed
*CMCCAT2000* transform sharpened *RGB* array and :math:`N_{bb}` chromatic
induction factor for forward *CIECAM02* implementation.
Parameters
... |
Compute the achromatic response :math:`A` from the specified compressed
*CMCCAT2000* transform sharpened *RGB* array and :math:`N_{bb}` chromatic
induction factor for forward *CIECAM02* implementation.
Parameters
----------
RGB
Compressed *CMCCAT2000* transform sharpened *RGB* array.
... | achromatic_response_forward | python | colour-science/colour | colour/appearance/ciecam02.py | https://github.com/colour-science/colour/blob/master/colour/appearance/ciecam02.py | BSD-3-Clause |
def achromatic_response_inverse(
A_w: ArrayLike,
J: ArrayLike,
c: ArrayLike,
z: ArrayLike,
) -> NDArrayFloat:
"""
Compute the achromatic response :math:`A` from the specified achromatic
response
:math:`A_w` for the whitepoint, *Lightness* correlate :math:`J`, surround
exponential non... |
Compute the achromatic response :math:`A` from the specified achromatic
response
:math:`A_w` for the whitepoint, *Lightness* correlate :math:`J`, surround
exponential non-linearity :math:`c` and base exponential non-linearity
:math:`z` for inverse *CIECAM02* implementation.
Parameters
----... | achromatic_response_inverse | python | colour-science/colour | colour/appearance/ciecam02.py | https://github.com/colour-science/colour/blob/master/colour/appearance/ciecam02.py | BSD-3-Clause |
def lightness_correlate(
A: ArrayLike,
A_w: ArrayLike,
c: ArrayLike,
z: ArrayLike,
) -> NDArrayFloat:
"""
Compute the *Lightness* correlate :math:`J`.
Parameters
----------
A
Achromatic response :math:`A` for the stimulus.
A_w
Achromatic response :math:`A_w` for ... |
Compute the *Lightness* correlate :math:`J`.
Parameters
----------
A
Achromatic response :math:`A` for the stimulus.
A_w
Achromatic response :math:`A_w` for the whitepoint.
c
Surround exponential non-linearity :math:`c`.
z
Base exponential non-linearity :mat... | lightness_correlate | python | colour-science/colour | colour/appearance/ciecam02.py | https://github.com/colour-science/colour/blob/master/colour/appearance/ciecam02.py | BSD-3-Clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.