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 write_LUT_SonySPI1D(
LUT: LUT1D | LUT3x1D | LUTSequence, path: str | PathLike, decimals: int = 7
) -> bool:
"""
Write the specified *LUT* to the specified *Sony* *.spi1d* *LUT* file.
Parameters
----------
LUT
:class:`LUT1D`, :class:`LUT3x1D` or :class:`LUTSequence` class instance
... |
Write the specified *LUT* to the specified *Sony* *.spi1d* *LUT* file.
Parameters
----------
LUT
:class:`LUT1D`, :class:`LUT3x1D` or :class:`LUTSequence` class instance
to write at specified path.
path
*LUT* path.
decimals
Formatting decimals.
Returns
-... | write_LUT_SonySPI1D | python | colour-science/colour | colour/io/luts/sony_spi1d.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/sony_spi1d.py | BSD-3-Clause |
def read_LUT_SonySPI3D(path: str | PathLike) -> LUT3D:
"""
Read specified *Sony* *.spi3d* *LUT* file.
Parameters
----------
path
*LUT* path.
Returns
-------
:class:`colour.LUT3D`
:class:`LUT3D` class instance.
Examples
--------
Reading an ordered and an uno... |
Read specified *Sony* *.spi3d* *LUT* file.
Parameters
----------
path
*LUT* path.
Returns
-------
:class:`colour.LUT3D`
:class:`LUT3D` class instance.
Examples
--------
Reading an ordered and an unordered 3D *Sony* *.spi3d* *LUT*:
>>> import os
>>> pa... | read_LUT_SonySPI3D | python | colour-science/colour | colour/io/luts/sony_spi3d.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/sony_spi3d.py | BSD-3-Clause |
def write_LUT_SonySPI3D(
LUT: LUT3D | LUTSequence, path: str | PathLike, decimals: int = 7
) -> bool:
"""
Write specified *LUT* to specified *Sony* *.spi3d* *LUT* file.
Parameters
----------
LUT
:class:`LUT3D` or :class:`LUTSequence` class instance to write at specified
path.
... |
Write specified *LUT* to specified *Sony* *.spi3d* *LUT* file.
Parameters
----------
LUT
:class:`LUT3D` or :class:`LUTSequence` class instance to write at specified
path.
path
*LUT* path.
decimals
Formatting decimals.
Returns
-------
:class:`bool`
... | write_LUT_SonySPI3D | python | colour-science/colour | colour/io/luts/sony_spi3d.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/sony_spi3d.py | BSD-3-Clause |
def read_LUT_SonySPImtx(path: str | PathLike[str]) -> LUTOperatorMatrix:
"""
Read specified *Sony* *.spimtx* *LUT* file.
Parameters
----------
path
*LUT* path.
Returns
-------
:class:`colour.LUTOperatorMatrix`
:class:`colour.io.Matrix` class instance.
Examples
... |
Read specified *Sony* *.spimtx* *LUT* file.
Parameters
----------
path
*LUT* path.
Returns
-------
:class:`colour.LUTOperatorMatrix`
:class:`colour.io.Matrix` class instance.
Examples
--------
>>> import os
>>> path = os.path.join(
... os.path.dirn... | read_LUT_SonySPImtx | python | colour-science/colour | colour/io/luts/sony_spimtx.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/sony_spimtx.py | BSD-3-Clause |
def write_LUT_SonySPImtx(
LUT: LUTOperatorMatrix,
path: str | PathLike[str] | typing.IO[typing.Any],
decimals: int = 7,
) -> bool:
"""
Write specified *LUT* to specified *Sony* *.spimtx* *LUT* file.
Parameters
----------
LUT
:class:`colour.LUTOperatorMatrix` class instance to wr... |
Write specified *LUT* to specified *Sony* *.spimtx* *LUT* file.
Parameters
----------
LUT
:class:`colour.LUTOperatorMatrix` class instance to write at specified
path.
path
*LUT* path.
decimals
Formatting decimals.
Returns
-------
:class:`bool`
... | write_LUT_SonySPImtx | python | colour-science/colour | colour/io/luts/sony_spimtx.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/sony_spimtx.py | BSD-3-Clause |
def read_LUT(
path: str | PathLike,
method: LiteralLUTReadMethod | str | None = None,
**kwargs: Any,
) -> LUT1D | LUT3x1D | LUT3D | LUTSequence | LUTOperatorMatrix:
"""
Read the specified *LUT* file using the specified method.
Parameters
----------
path
*LUT* path.
method
... |
Read the specified *LUT* file using the specified method.
Parameters
----------
path
*LUT* path.
method
Reading method, if *None*, the method will be auto-detected
according to extension.
Returns
-------
:class:`colour.LUT1D` or :class:`colour.LUT3x1D` or :clas... | read_LUT | python | colour-science/colour | colour/io/luts/__init__.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/__init__.py | BSD-3-Clause |
def write_LUT(
LUT: LUT1D | LUT3x1D | LUT3D | LUTSequence | LUTOperatorMatrix,
path: str | PathLike,
decimals: int = 7,
method: LiteralLUTWriteMethod | str | None = None,
**kwargs: Any,
) -> bool:
"""
Write the specified *LUT* to the specified file using the specified method.
Parameters... |
Write the specified *LUT* to the specified file using the specified method.
Parameters
----------
LUT
:class:`colour.LUT1D` or :class:`colour.LUT3x1D` or
:class:`colour.LUT3D` or :class:`colour.LUTSequence` or
:class:`colour.LUTOperatorMatrix` class instance to write at specifi... | write_LUT | python | colour-science/colour | colour/io/luts/__init__.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/__init__.py | BSD-3-Clause |
def test_read_LUT_Cinespace(self) -> None:
"""
Test :func:`colour.io.luts.cinespace_csp.read_LUT_Cinespace`
definition.
"""
LUT_1 = cast(
LUT3x1D,
read_LUT_Cinespace(os.path.join(ROOT_LUTS, "ACES_Proxy_10_to_ACES.csp")),
)
np.testing.asse... |
Test :func:`colour.io.luts.cinespace_csp.read_LUT_Cinespace`
definition.
| test_read_LUT_Cinespace | python | colour-science/colour | colour/io/luts/tests/test_cinespace_csp.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_cinespace_csp.py | BSD-3-Clause |
def test_write_LUT_Cinespace(self) -> None:
"""
Test :func:`colour.io.luts.cinespace_csp.write_LUT_Cinespace`
definition.
"""
LUT_1_r = read_LUT_Cinespace(
os.path.join(ROOT_LUTS, "ACES_Proxy_10_to_ACES.csp")
)
write_LUT_Cinespace(
LUT_1_r... |
Test :func:`colour.io.luts.cinespace_csp.write_LUT_Cinespace`
definition.
| test_write_LUT_Cinespace | python | colour-science/colour | colour/io/luts/tests/test_cinespace_csp.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_cinespace_csp.py | BSD-3-Clause |
def test_path_to_title(self) -> None:
"""Test :func:`colour.io.luts.common.path_to_title` definition."""
assert (
path_to_title("colour/io/luts/tests/resources/cinespace/RGB_1_0.5_0.25.csp")
== "RGB 1 0 5 0 25"
) | Test :func:`colour.io.luts.common.path_to_title` definition. | test_path_to_title | python | colour-science/colour | colour/io/luts/tests/test_common.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_common.py | BSD-3-Clause |
def test_read_LUT_IridasCube(self) -> None:
"""
Test :func:`colour.io.luts.iridas_cube.read_LUT_IridasCube`
definition.
"""
LUT_1 = read_LUT_IridasCube(
os.path.join(ROOT_LUTS, "ACES_Proxy_10_to_ACES.cube")
)
np.testing.assert_allclose(
L... |
Test :func:`colour.io.luts.iridas_cube.read_LUT_IridasCube`
definition.
| test_read_LUT_IridasCube | python | colour-science/colour | colour/io/luts/tests/test_iridas_cube.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_iridas_cube.py | BSD-3-Clause |
def test_write_LUT_IridasCube(self) -> None:
"""
Test :func:`colour.io.luts.iridas_cube.write_LUT_IridasCube`
definition.
"""
LUT_1_r = read_LUT_IridasCube(
os.path.join(ROOT_LUTS, "ACES_Proxy_10_to_ACES.cube")
)
write_LUT_IridasCube(
LUT_... |
Test :func:`colour.io.luts.iridas_cube.write_LUT_IridasCube`
definition.
| test_write_LUT_IridasCube | python | colour-science/colour | colour/io/luts/tests/test_iridas_cube.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_iridas_cube.py | BSD-3-Clause |
def test__init__(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT1D.__init__` method.
"""
LUT = LUT1D(self._table_1)
np.testing.assert_allclose(
LUT.table, self._table_1, atol=TOLERANCE_ABSOLUTE_TESTS
)
assert str(id(LUT)) == LUT.name
... |
Test :class:`colour.io.luts.lut.LUT1D.__init__` method.
| test__init__ | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_table(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT1D.table` property.
"""
LUT = LUT1D()
np.testing.assert_array_equal(LUT.table, LUT.linear_table(self._size))
table_1 = self._table_1 * 0.8 + 0.1
LUT.table = table_1
np.testing.assert_a... |
Test :class:`colour.io.luts.lut.LUT1D.table` property.
| test_table | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_name(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT1D.name` property.
"""
LUT = LUT1D(self._table_1)
assert LUT.name == str(id(LUT))
LUT = LUT1D()
assert LUT.name == f"Unity {self._table_1.shape[0]}" |
Test :class:`colour.io.luts.lut.LUT1D.name` property.
| test_name | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_domain(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT1D.domain` property.
"""
LUT = LUT1D()
np.testing.assert_array_equal(LUT.domain, self._domain_1)
domain = self._domain_1 * 0.8 + 0.1
LUT.domain = domain
np.testing.assert_array_equal(... |
Test :class:`colour.io.luts.lut.LUT1D.domain` property.
| test_domain | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_size(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT1D.size` property.
"""
LUT = LUT1D()
assert LUT.size == LUT.table.shape[0] |
Test :class:`colour.io.luts.lut.LUT1D.size` property.
| test_size | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_dimensions(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT1D.dimensions` property.
"""
LUT = LUT1D()
assert LUT.dimensions == self._dimensions |
Test :class:`colour.io.luts.lut.LUT1D.dimensions` property.
| test_dimensions | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_comments(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT1D.comments` property.
"""
LUT = LUT1D()
assert LUT.comments == []
comments = ["A first comment.", "A second comment."]
LUT = LUT1D(comments=comments)
assert LUT.comments == comment... |
Test :class:`colour.io.luts.lut.LUT1D.comments` property.
| test_comments | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test__str__(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT1D.__str__` property.
"""
LUT = LUT1D(name="Nemo")
assert str(LUT) == self._str |
Test :class:`colour.io.luts.lut.LUT1D.__str__` property.
| test__str__ | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test__repr__(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT1D.__repr__` method.
"""
LUT = LUT1D(name="Nemo", comments=["A first comment.", "A second comment."])
# The default LUT representation is too large to be embedded, given
# that :class:`colour.io.luts... |
Test :class:`colour.io.luts.lut.LUT1D.__repr__` method.
| test__repr__ | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test__eq__(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT1D.__eq__` method.
"""
LUT_1 = LUT1D()
LUT_2 = LUT1D()
assert LUT_1 == LUT_2 |
Test :class:`colour.io.luts.lut.LUT1D.__eq__` method.
| test__eq__ | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test__ne__(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT1D.__ne__` method.
"""
LUT_1 = LUT1D()
LUT_2 = LUT1D()
LUT_2 += 0.1
assert LUT_1 != LUT_2
LUT_2 = LUT1D()
LUT_2.domain = self._domain_1 * 0.8 + 0.1
assert LUT_1 != LUT_... |
Test :class:`colour.io.luts.lut.LUT1D.__ne__` method.
| test__ne__ | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_is_domain_explicit(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT1D.is_domain_explicit` method.
"""
assert not LUT1D().is_domain_explicit()
assert LUT1D(self._table_3, domain=self._domain_3).is_domain_explicit() |
Test :class:`colour.io.luts.lut.LUT1D.is_domain_explicit` method.
| test_is_domain_explicit | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_arithmetical_operation(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT1D.arithmetical_operation` method.
"""
LUT_1 = LUT1D()
LUT_2 = LUT1D()
np.testing.assert_allclose(
LUT_1.arithmetical_operation(10, "+", False).table,
self._tab... |
Test :class:`colour.io.luts.lut.LUT1D.arithmetical_operation` method.
| test_arithmetical_operation | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_linear_table(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT1D.linear_table` method.
"""
LUT_1 = LUT1D()
np.testing.assert_allclose(
LUT_1.linear_table(self._size),
self._table_1,
atol=TOLERANCE_ABSOLUTE_TESTS,
)
... |
Test :class:`colour.io.luts.lut.LUT1D.linear_table` method.
| test_linear_table | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_copy(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT1D.copy` method.
"""
LUT_1 = LUT1D()
assert LUT_1 is not LUT_1.copy()
assert LUT_1.copy() == LUT_1 |
Test :class:`colour.io.luts.lut.LUT1D.copy` method.
| test_copy | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_invert(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT1D.invert` method.
"""
LUT_i = LUT1D(self._table_2).invert(
interpolator=self._interpolator_1, **self._invert_kwargs_1
)
np.testing.assert_allclose(
LUT_i.apply(RANDOM_TRIPLETS... |
Test :class:`colour.io.luts.lut.LUT1D.invert` method.
| test_invert | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_apply(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT1D.apply` method.
"""
LUT_1 = LUT1D(self._table_2)
np.testing.assert_allclose(
LUT_1.apply(RANDOM_TRIPLETS),
self._applied_1,
atol=TOLERANCE_ABSOLUTE_TESTS,
)
... |
Test :class:`colour.io.luts.lut.LUT1D.apply` method.
| test_apply | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test__init__(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3x1D.__init__` method.
"""
LUT = LUT3x1D(self._table_1)
np.testing.assert_allclose(
LUT.table, self._table_1, atol=TOLERANCE_ABSOLUTE_TESTS
)
assert str(id(LUT)) == LUT.name
... |
Test :class:`colour.io.luts.lut.LUT3x1D.__init__` method.
| test__init__ | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_table(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3x1D.table` property.
"""
LUT = LUT3x1D()
np.testing.assert_array_equal(LUT.table, LUT.linear_table(self._size))
table_1 = self._table_1 * 0.8 + 0.1
LUT.table = table_1
np.testing.asse... |
Test :class:`colour.io.luts.lut.LUT3x1D.table` property.
| test_table | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_name(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3x1D.name` property.
"""
LUT = LUT3x1D(self._table_1)
assert LUT.name == str(id(LUT))
LUT = LUT3x1D()
assert LUT.name == f"Unity {self._table_1.shape[0]}" |
Test :class:`colour.io.luts.lut.LUT3x1D.name` property.
| test_name | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_domain(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3x1D.domain` property.
"""
LUT = LUT3x1D()
np.testing.assert_array_equal(LUT.domain, self._domain_1)
domain = self._domain_1 * 0.8 + 0.1
LUT.domain = domain
np.testing.assert_array_eq... |
Test :class:`colour.io.luts.lut.LUT3x1D.domain` property.
| test_domain | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_size(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3x1D.size` property.
"""
LUT = LUT3x1D()
assert LUT.size == LUT.table.shape[0] |
Test :class:`colour.io.luts.lut.LUT3x1D.size` property.
| test_size | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_dimensions(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3x1D.dimensions` property.
"""
LUT = LUT3x1D()
assert LUT.dimensions == self._dimensions |
Test :class:`colour.io.luts.lut.LUT3x1D.dimensions` property.
| test_dimensions | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_comments(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3x1D.comments` property.
"""
LUT = LUT3x1D()
assert LUT.comments == []
comments = ["A first comment.", "A second comment."]
LUT = LUT3x1D(comments=comments)
assert LUT.comments == c... |
Test :class:`colour.io.luts.lut.LUT3x1D.comments` property.
| test_comments | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test__str__(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3x1D.__str__` property.
"""
LUT = LUT3x1D(name="Nemo")
assert str(LUT) == self._str |
Test :class:`colour.io.luts.lut.LUT3x1D.__str__` property.
| test__str__ | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test__repr__(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3x1D.__repr__` method.
"""
LUT = LUT3x1D(name="Nemo", comments=["A first comment.", "A second comment."])
# The default LUT representation is too large to be embedded, given
# that :class:`colour.io.... |
Test :class:`colour.io.luts.lut.LUT3x1D.__repr__` method.
| test__repr__ | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test__eq__(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3x1D.__eq__` method.
"""
LUT_1 = LUT3x1D()
LUT_2 = LUT3x1D()
assert LUT_1 == LUT_2 |
Test :class:`colour.io.luts.lut.LUT3x1D.__eq__` method.
| test__eq__ | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test__ne__(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3x1D.__ne__` method.
"""
LUT_1 = LUT3x1D()
LUT_2 = LUT3x1D()
LUT_2 += 0.1
assert LUT_1 != LUT_2
LUT_2 = LUT3x1D()
LUT_2.domain = self._domain_1 * 0.8 + 0.1
assert LUT_1... |
Test :class:`colour.io.luts.lut.LUT3x1D.__ne__` method.
| test__ne__ | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_is_domain_explicit(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3x1D.is_domain_explicit` method.
"""
assert not LUT3x1D().is_domain_explicit()
assert LUT3x1D(self._table_3, domain=self._domain_3).is_domain_explicit() |
Test :class:`colour.io.luts.lut.LUT3x1D.is_domain_explicit` method.
| test_is_domain_explicit | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_arithmetical_operation(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3x1D.arithmetical_operation` method.
"""
LUT_1 = LUT3x1D()
LUT_2 = LUT3x1D()
np.testing.assert_allclose(
LUT_1.arithmetical_operation(10, "+", False).table,
sel... |
Test :class:`colour.io.luts.lut.LUT3x1D.arithmetical_operation` method.
| test_arithmetical_operation | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_linear_table(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3x1D.linear_table` method.
"""
LUT_1 = LUT3x1D()
np.testing.assert_allclose(
LUT_1.linear_table(self._size),
self._table_1,
atol=TOLERANCE_ABSOLUTE_TESTS,
)
... |
Test :class:`colour.io.luts.lut.LUT3x1D.linear_table` method.
| test_linear_table | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_copy(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3x1D.copy` method.
"""
LUT_1 = LUT3x1D()
assert LUT_1 is not LUT_1.copy()
assert LUT_1.copy() == LUT_1 |
Test :class:`colour.io.luts.lut.LUT3x1D.copy` method.
| test_copy | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_invert(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3x1D.invert` method.
"""
LUT_i = LUT3x1D(self._table_2).invert(
interpolator=self._interpolator_1, **self._invert_kwargs_1
)
np.testing.assert_allclose(
LUT_i.apply(RANDOM_TRIP... |
Test :class:`colour.io.luts.lut.LUT3x1D.invert` method.
| test_invert | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_apply(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3x1D.apply` method.
"""
LUT_1 = LUT3x1D(self._table_2)
np.testing.assert_allclose(
LUT_1.apply(RANDOM_TRIPLETS),
self._applied_1,
atol=TOLERANCE_ABSOLUTE_TESTS,
)
... |
Test :class:`colour.io.luts.lut.LUT3x1D.apply` method.
| test_apply | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test__init__(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3D.__init__` method.
"""
LUT = LUT3D(self._table_1)
np.testing.assert_allclose(
LUT.table, self._table_1, atol=TOLERANCE_ABSOLUTE_TESTS
)
assert str(id(LUT)) == LUT.name
... |
Test :class:`colour.io.luts.lut.LUT3D.__init__` method.
| test__init__ | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_table(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3D.table` property.
"""
LUT = LUT3D()
np.testing.assert_array_equal(LUT.table, LUT.linear_table(self._size))
table_1 = self._table_1 * 0.8 + 0.1
LUT.table = table_1
np.testing.assert_a... |
Test :class:`colour.io.luts.lut.LUT3D.table` property.
| test_table | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_name(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3D.name` property.
"""
LUT = LUT3D(self._table_1)
assert LUT.name == str(id(LUT))
LUT = LUT3D()
assert LUT.name == f"Unity {self._table_1.shape[0]}" |
Test :class:`colour.io.luts.lut.LUT3D.name` property.
| test_name | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_domain(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3D.domain` property.
"""
LUT = LUT3D()
np.testing.assert_array_equal(LUT.domain, self._domain_1)
domain = self._domain_1 * 0.8 + 0.1
LUT.domain = domain
np.testing.assert_array_equal(... |
Test :class:`colour.io.luts.lut.LUT3D.domain` property.
| test_domain | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_size(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3D.size` property.
"""
LUT = LUT3D()
assert LUT.size == LUT.table.shape[0] |
Test :class:`colour.io.luts.lut.LUT3D.size` property.
| test_size | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_dimensions(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3D.dimensions` property.
"""
LUT = LUT3D()
assert LUT.dimensions == self._dimensions |
Test :class:`colour.io.luts.lut.LUT3D.dimensions` property.
| test_dimensions | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_comments(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3D.comments` property.
"""
LUT = LUT3D()
assert LUT.comments == []
comments = ["A first comment.", "A second comment."]
LUT = LUT3D(comments=comments)
assert LUT.comments == comment... |
Test :class:`colour.io.luts.lut.LUT3D.comments` property.
| test_comments | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test__str__(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3D.__str__` property.
"""
LUT = LUT3D(name="Nemo")
assert str(LUT) == self._str |
Test :class:`colour.io.luts.lut.LUT3D.__str__` property.
| test__str__ | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test__repr__(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3D.__repr__` method.
"""
LUT = LUT3D(name="Nemo", comments=["A first comment.", "A second comment."])
# The default LUT representation is too large to be embedded, given
# that :class:`colour.io.luts... |
Test :class:`colour.io.luts.lut.LUT3D.__repr__` method.
| test__repr__ | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test__eq__(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3D.__eq__` method.
"""
LUT_1 = LUT3D()
LUT_2 = LUT3D()
assert LUT_1 == LUT_2 |
Test :class:`colour.io.luts.lut.LUT3D.__eq__` method.
| test__eq__ | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test__ne__(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3D.__ne__` method.
"""
LUT_1 = LUT3D()
LUT_2 = LUT3D()
LUT_2 += 0.1
assert LUT_1 != LUT_2
LUT_2 = LUT3D()
LUT_2.domain = self._domain_1 * 0.8 + 0.1
assert LUT_1 != LUT_... |
Test :class:`colour.io.luts.lut.LUT3D.__ne__` method.
| test__ne__ | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_is_domain_explicit(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3D.is_domain_explicit` method.
"""
assert not LUT3D().is_domain_explicit()
assert LUT3D(self._table_3, domain=self._domain_3).is_domain_explicit() |
Test :class:`colour.io.luts.lut.LUT3D.is_domain_explicit` method.
| test_is_domain_explicit | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_arithmetical_operation(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3D.arithmetical_operation` method.
"""
LUT_1 = LUT3D()
LUT_2 = LUT3D()
np.testing.assert_allclose(
LUT_1.arithmetical_operation(10, "+", False).table,
self._tab... |
Test :class:`colour.io.luts.lut.LUT3D.arithmetical_operation` method.
| test_arithmetical_operation | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_linear_table(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3D.linear_table` method.
"""
LUT_1 = LUT3D()
np.testing.assert_allclose(
LUT_1.linear_table(self._size),
self._table_1,
atol=TOLERANCE_ABSOLUTE_TESTS,
)
... |
Test :class:`colour.io.luts.lut.LUT3D.linear_table` method.
| test_linear_table | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_copy(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3D.copy` method.
"""
LUT_1 = LUT3D()
assert LUT_1 is not LUT_1.copy()
assert LUT_1.copy() == LUT_1 |
Test :class:`colour.io.luts.lut.LUT3D.copy` method.
| test_copy | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_invert(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3D.invert` method.
"""
LUT_i = LUT3D(self._table_2).invert(
interpolator=self._interpolator_1, **self._invert_kwargs_1
)
np.testing.assert_allclose(
LUT_i.apply(RANDOM_TRIPLETS... |
Test :class:`colour.io.luts.lut.LUT3D.invert` method.
| test_invert | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_apply(self) -> None:
"""
Test :class:`colour.io.luts.lut.LUT3D.apply` method.
"""
LUT_1 = LUT3D(self._table_2)
np.testing.assert_allclose(
LUT_1.apply(RANDOM_TRIPLETS),
self._applied_1,
atol=TOLERANCE_ABSOLUTE_TESTS,
)
... |
Test :class:`colour.io.luts.lut.LUT3D.apply` method.
| test_apply | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_LUT_to_LUT(self) -> None:
"""Test :func:`colour.io.luts.lut.LUT_to_LUT` definition."""
# "LUT" 1D to "LUT" 1D.
LUT = LUT_to_LUT(self._LUT_1, LUT1D)
assert LUT == self._LUT_1
# "LUT" 1D to "LUT" 3x1D.
LUT = LUT_to_LUT(self._LUT_1, LUT3x1D)
table = LUT1D... | Test :func:`colour.io.luts.lut.LUT_to_LUT` definition. | test_LUT_to_LUT | python | colour-science/colour | colour/io/luts/tests/test_lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_lut.py | BSD-3-Clause |
def test_matrix(self) -> None:
"""
Test :class:`colour.io.luts.operator.LUTOperatorMatrix.matrix`
property.
"""
M = np.identity(3)
lut_operator_matrix = LUTOperatorMatrix(M)
np.testing.assert_array_equal(lut_operator_matrix.matrix, np.identity(4)) |
Test :class:`colour.io.luts.operator.LUTOperatorMatrix.matrix`
property.
| test_matrix | python | colour-science/colour | colour/io/luts/tests/test_operator.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_operator.py | BSD-3-Clause |
def test_offset(self) -> None:
"""
Test :class:`colour.io.luts.operator.LUTOperatorMatrix.offset`
property.
"""
offset = zeros(3)
lut_operator_matrix = LUTOperatorMatrix(np.identity(3), offset)
np.testing.assert_array_equal(lut_operator_matrix.offset, zeros(4)) |
Test :class:`colour.io.luts.operator.LUTOperatorMatrix.offset`
property.
| test_offset | python | colour-science/colour | colour/io/luts/tests/test_operator.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_operator.py | BSD-3-Clause |
def test__str__(self) -> None:
"""
Test :class:`colour.io.luts.operator.LUTOperatorMatrix.__str__`
method.
"""
assert (
str(self._lut_operator_matrix)
== (
textwrap.dedent(
"""
LUTOperatorMatrix - Nemo Matri... |
Test :class:`colour.io.luts.operator.LUTOperatorMatrix.__str__`
method.
| test__str__ | python | colour-science/colour | colour/io/luts/tests/test_operator.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_operator.py | BSD-3-Clause |
def test__repr__(self) -> None:
"""
Test :class:`colour.io.luts.operator.LUTOperatorMatrix.__repr__`
method.
"""
assert repr(self._lut_operator_matrix) == (
textwrap.dedent(
"""
LUTOperatorMatrix([[ 0. , 0.06666667, 0.13333333, 0.2 ],
... |
Test :class:`colour.io.luts.operator.LUTOperatorMatrix.__repr__`
method.
| test__repr__ | python | colour-science/colour | colour/io/luts/tests/test_operator.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_operator.py | BSD-3-Clause |
def test__eq__(self) -> None:
"""Test :class:`colour.io.luts.operator.LUTOperatorMatrix.__eq__` method."""
matrix = LUTOperatorMatrix(
np.reshape(np.linspace(0, 1, 16), (4, 4)),
np.array([0.25, 0.5, 0.75, 1.0]),
)
assert self._lut_operator_matrix == matrix | Test :class:`colour.io.luts.operator.LUTOperatorMatrix.__eq__` method. | test__eq__ | python | colour-science/colour | colour/io/luts/tests/test_operator.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_operator.py | BSD-3-Clause |
def test__neq__(self) -> None:
"""
Test :class:`colour.io.luts.operator.LUTOperatorMatrix.__neq__`
method.
"""
matrix = LUTOperatorMatrix(np.reshape(np.linspace(0, 1, 16), (4, 4)) * 0.75)
assert self._lut_operator_matrix != matrix |
Test :class:`colour.io.luts.operator.LUTOperatorMatrix.__neq__`
method.
| test__neq__ | python | colour-science/colour | colour/io/luts/tests/test_operator.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_operator.py | BSD-3-Clause |
def test_apply(self) -> None:
"""Test :class:`colour.io.luts.operator.LUTOperatorMatrix.apply` method."""
samples = np.linspace(0, 1, 5)
RGB = tstack([samples, samples, samples])
np.testing.assert_array_equal(LUTOperatorMatrix().apply(RGB), RGB)
np.testing.assert_allclose(
... | Test :class:`colour.io.luts.operator.LUTOperatorMatrix.apply` method. | test_apply | python | colour-science/colour | colour/io/luts/tests/test_operator.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_operator.py | BSD-3-Clause |
def test_read_LUT_ResolveCube(self) -> None:
"""
Test :func:`colour.io.luts.resolve_cube.read_LUT_ResolveCube`
definition.
"""
LUT_1 = cast(
LUT3x1D,
read_LUT_ResolveCube(os.path.join(ROOT_LUTS, "ACES_Proxy_10_to_ACES.cube")),
)
np.testin... |
Test :func:`colour.io.luts.resolve_cube.read_LUT_ResolveCube`
definition.
| test_read_LUT_ResolveCube | python | colour-science/colour | colour/io/luts/tests/test_resolve_cube.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_resolve_cube.py | BSD-3-Clause |
def test_write_LUT_ResolveCube(self) -> None:
"""
Test :func:`colour.io.luts.resolve_cube.write_LUT_ResolveCube`
definition.
"""
LUT_1_r = read_LUT_ResolveCube(
os.path.join(ROOT_LUTS, "ACES_Proxy_10_to_ACES.cube")
)
write_LUT_ResolveCube(
... |
Test :func:`colour.io.luts.resolve_cube.write_LUT_ResolveCube`
definition.
| test_write_LUT_ResolveCube | python | colour-science/colour | colour/io/luts/tests/test_resolve_cube.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_resolve_cube.py | BSD-3-Clause |
def test_sequence(self) -> None:
"""Test :class:`colour.io.luts.sequence.LUTSequence.sequence` property."""
sequence = [self._LUT_1, self._LUT_2, self._LUT_3]
LUT_sequence = LUTSequence()
LUT_sequence.sequence = sequence
assert self._LUT_sequence.sequence == sequence | Test :class:`colour.io.luts.sequence.LUTSequence.sequence` property. | test_sequence | python | colour-science/colour | colour/io/luts/tests/test_sequence.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_sequence.py | BSD-3-Clause |
def test__getitem__(self) -> None:
"""Test :class:`colour.io.luts.sequence.LUTSequence.__getitem__` method."""
assert self._LUT_sequence[0] == self._LUT_1
assert self._LUT_sequence[1] == self._LUT_2
assert self._LUT_sequence[2] == self._LUT_3 | Test :class:`colour.io.luts.sequence.LUTSequence.__getitem__` method. | test__getitem__ | python | colour-science/colour | colour/io/luts/tests/test_sequence.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_sequence.py | BSD-3-Clause |
def test__setitem__(self) -> None:
"""Test :class:`colour.io.luts.sequence.LUTSequence.__setitem__` method."""
LUT_sequence = self._LUT_sequence.copy()
LUT_sequence[0] = self._LUT_3
LUT_sequence[1] = self._LUT_1
LUT_sequence[2] = self._LUT_2
assert LUT_sequence[1] == se... | Test :class:`colour.io.luts.sequence.LUTSequence.__setitem__` method. | test__setitem__ | python | colour-science/colour | colour/io/luts/tests/test_sequence.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_sequence.py | BSD-3-Clause |
def test__delitem__(self) -> None:
"""Test :class:`colour.io.luts.sequence.LUTSequence.__delitem__` method."""
LUT_sequence = self._LUT_sequence.copy()
del LUT_sequence[0]
del LUT_sequence[0]
assert LUT_sequence[0] == self._LUT_3 | Test :class:`colour.io.luts.sequence.LUTSequence.__delitem__` method. | test__delitem__ | python | colour-science/colour | colour/io/luts/tests/test_sequence.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_sequence.py | BSD-3-Clause |
def test__str__(self) -> None:
"""Test :class:`colour.io.luts.sequence.LUTSequence.__str__` method."""
assert str(self._LUT_sequence) == (
textwrap.dedent(
"""
LUT Sequence
------------
Overview
LUT1D --> LUT3D --> LUT3x1... | Test :class:`colour.io.luts.sequence.LUTSequence.__str__` method. | test__str__ | python | colour-science/colour | colour/io/luts/tests/test_sequence.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_sequence.py | BSD-3-Clause |
def test__repr__(self) -> None:
"""Test :class:`colour.io.luts.sequence.LUTSequence.__repr__` method."""
LUT_sequence = self._LUT_sequence.copy()
LUT_sequence[1].table = LUT3D.linear_table(5)
assert repr(LUT_sequence) == (
textwrap.dedent(
"""
LUTSequence(
... | Test :class:`colour.io.luts.sequence.LUTSequence.__repr__` method. | test__repr__ | python | colour-science/colour | colour/io/luts/tests/test_sequence.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_sequence.py | BSD-3-Clause |
def test__eq__(self) -> None:
"""Test :class:`colour.io.luts.sequence.LUTSequence.__eq__` method."""
LUT_sequence_1 = LUTSequence(self._LUT_1, self._LUT_2, self._LUT_3)
LUT_sequence_2 = LUTSequence(self._LUT_1, self._LUT_2)
assert self._LUT_sequence == LUT_sequence_1
assert se... | Test :class:`colour.io.luts.sequence.LUTSequence.__eq__` method. | test__eq__ | python | colour-science/colour | colour/io/luts/tests/test_sequence.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_sequence.py | BSD-3-Clause |
def test__neq__(self) -> None:
"""Test :class:`colour.io.luts.sequence.LUTSequence.__neq__` method."""
assert self._LUT_sequence != LUTSequence(
self._LUT_1, self._LUT_2.copy() * 0.75, self._LUT_3
) | Test :class:`colour.io.luts.sequence.LUTSequence.__neq__` method. | test__neq__ | python | colour-science/colour | colour/io/luts/tests/test_sequence.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_sequence.py | BSD-3-Clause |
def test_insert(self) -> None:
"""Test :class:`colour.io.luts.sequence.LUTSequence.insert` method."""
LUT_sequence = self._LUT_sequence.copy()
LUT_sequence.insert(1, self._LUT_2.copy())
assert LUT_sequence == LUTSequence(
self._LUT_1,
self._LUT_2,
s... | Test :class:`colour.io.luts.sequence.LUTSequence.insert` method. | test_insert | python | colour-science/colour | colour/io/luts/tests/test_sequence.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_sequence.py | BSD-3-Clause |
def test_apply(self) -> None:
"""Test :class:`colour.io.luts.sequence.LUTSequence.apply` method."""
class GammaOperator(AbstractLUTSequenceOperator):
"""
Gamma operator for unit tests.
Parameters
----------
gamma
Gamma value.
... | Test :class:`colour.io.luts.sequence.LUTSequence.apply` method. | test_apply | python | colour-science/colour | colour/io/luts/tests/test_sequence.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_sequence.py | BSD-3-Clause |
def apply(
self,
RGB: ArrayLike,
*args: Any, # noqa: ARG002
**kwargs: Any,
) -> NDArrayFloat:
"""
Apply the *LUT* sequence operator to specified *RGB* colourspace
array.
Paramete... |
Apply the *LUT* sequence operator to specified *RGB* colourspace
array.
Parameters
----------
RGB
*RGB* colourspace array to apply the *LUT* sequence
operator onto.
Returns
... | apply | python | colour-science/colour | colour/io/luts/tests/test_sequence.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_sequence.py | BSD-3-Clause |
def test_read_LUT_SonySPI1D(self) -> None:
"""Test :func:`colour.io.luts.sony_spi1d.read_LUT_SonySPI1D` definition."""
LUT_1 = read_LUT_SonySPI1D(os.path.join(ROOT_LUTS, "eotf_sRGB_1D.spi1d"))
np.testing.assert_allclose(
LUT_1.table,
np.array(
[
... | Test :func:`colour.io.luts.sony_spi1d.read_LUT_SonySPI1D` definition. | test_read_LUT_SonySPI1D | python | colour-science/colour | colour/io/luts/tests/test_sony_spi1d.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_sony_spi1d.py | BSD-3-Clause |
def test_write_LUT_SonySPI1D(self) -> None:
"""Test :func:`colour.io.luts.sony_spi1d.write_LUT_SonySPI1D` definition."""
LUT_1_r = read_LUT_SonySPI1D(os.path.join(ROOT_LUTS, "eotf_sRGB_1D.spi1d"))
write_LUT_SonySPI1D(
LUT_1_r,
os.path.join(self._temporary_directory, "eot... | Test :func:`colour.io.luts.sony_spi1d.write_LUT_SonySPI1D` definition. | test_write_LUT_SonySPI1D | python | colour-science/colour | colour/io/luts/tests/test_sony_spi1d.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_sony_spi1d.py | BSD-3-Clause |
def test_read_LUT_SonySPI3D(self) -> None:
"""Test :func:`colour.io.luts.sony_spi3d.read_LUT_SonySPI3D` definition."""
LUT_1 = read_LUT_SonySPI3D(os.path.join(ROOT_LUTS, "Colour_Correct.spi3d"))
np.testing.assert_allclose(
LUT_1.table,
np.array(
[
... | Test :func:`colour.io.luts.sony_spi3d.read_LUT_SonySPI3D` definition. | test_read_LUT_SonySPI3D | python | colour-science/colour | colour/io/luts/tests/test_sony_spi3d.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_sony_spi3d.py | BSD-3-Clause |
def test_write_LUT_SonySPI3D(self) -> None:
"""Test :func:`colour.io.luts.sony_spi3d.write_LUT_SonySPI3D` definition."""
LUT_r = read_LUT_SonySPI3D(os.path.join(ROOT_LUTS, "Colour_Correct.spi3d"))
write_LUT_SonySPI3D(
LUT_r,
os.path.join(self._temporary_directory, "Colo... | Test :func:`colour.io.luts.sony_spi3d.write_LUT_SonySPI3D` definition. | test_write_LUT_SonySPI3D | python | colour-science/colour | colour/io/luts/tests/test_sony_spi3d.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_sony_spi3d.py | BSD-3-Clause |
def test_read_LUT_SonySPImtx(self) -> None:
"""
Test :func:`colour.io.luts.sony_spimtx.read_LUT_SonySPImtx`
definition.
"""
LUT_1 = read_LUT_SonySPImtx(os.path.join(ROOT_LUTS, "dt.spimtx"))
np.testing.assert_allclose(
LUT_1.matrix,
np.array(
... |
Test :func:`colour.io.luts.sony_spimtx.read_LUT_SonySPImtx`
definition.
| test_read_LUT_SonySPImtx | python | colour-science/colour | colour/io/luts/tests/test_sony_spimtx.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_sony_spimtx.py | BSD-3-Clause |
def test_write_LUT_SonySPImtx(self) -> None:
"""
Test :func:`colour.io.luts.sony_spimtx.write_LUT_SonySPImtx`
definition.
"""
LUT_1_r = read_LUT_SonySPImtx(os.path.join(ROOT_LUTS, "dt.spimtx"))
write_LUT_SonySPImtx(
LUT_1_r, os.path.join(self._temporary_direc... |
Test :func:`colour.io.luts.sony_spimtx.write_LUT_SonySPImtx`
definition.
| test_write_LUT_SonySPImtx | python | colour-science/colour | colour/io/luts/tests/test_sony_spimtx.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test_sony_spimtx.py | BSD-3-Clause |
def test_read_LUT(self) -> None:
"""Test :func:`colour.io.luts.__init__.read_LUT` definition."""
LUT_1 = cast(
LUT1D, read_LUT(os.path.join(ROOT_LUTS, "sony_spi1d", "eotf_sRGB_1D.spi1d"))
)
np.testing.assert_allclose(
LUT_1.table,
np.array(
... | Test :func:`colour.io.luts.__init__.read_LUT` definition. | test_read_LUT | python | colour-science/colour | colour/io/luts/tests/test__init__.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test__init__.py | BSD-3-Clause |
def test_raise_exception_read_LUT(self) -> None:
"""
Test :func:`colour.io.luts.__init__.read_LUT` definition raised
exception.
"""
pytest.raises(
ValueError,
read_LUT,
os.path.join(ROOT_LUTS, "sony_spi1d", "Exception_Raising.spi1d"),
... |
Test :func:`colour.io.luts.__init__.read_LUT` definition raised
exception.
| test_raise_exception_read_LUT | python | colour-science/colour | colour/io/luts/tests/test__init__.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test__init__.py | BSD-3-Clause |
def test_write_LUT(self) -> None:
"""Test :func:`colour.io.luts.__init__.write_LUT` definition."""
LUT_1_r = read_LUT(os.path.join(ROOT_LUTS, "sony_spi1d", "eotf_sRGB_1D.spi1d"))
write_LUT(
LUT_1_r,
os.path.join(self._temporary_directory, "eotf_sRGB_1D.spi1d"),
... | Test :func:`colour.io.luts.__init__.write_LUT` definition. | test_write_LUT | python | colour-science/colour | colour/io/luts/tests/test__init__.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/tests/test__init__.py | BSD-3-Clause |
def test_ctl_render(self) -> None: # pragma: no cover
"""Test :func:`colour.io.ctl.ctl_render` definition."""
if not is_ctlrender_installed():
return
ctl_adjust_gain_float = template_ctl_transform_float(
"rIn * gain[0]",
"gIn * gain[1]",
"bIn * ... | Test :func:`colour.io.ctl.ctl_render` definition. | test_ctl_render | python | colour-science/colour | colour/io/tests/test_ctl.py | https://github.com/colour-science/colour/blob/master/colour/io/tests/test_ctl.py | BSD-3-Clause |
def test_process_image_ctl(self) -> None: # pragma: no cover
"""Test :func:`colour.io.ctl.process_image_ctl` definition."""
if not is_ctlrender_installed():
return
ctl_adjust_gain_float = template_ctl_transform_float(
"rIn * gain[0]",
"gIn * gain[1]",
... | Test :func:`colour.io.ctl.process_image_ctl` definition. | test_process_image_ctl | python | colour-science/colour | colour/io/tests/test_ctl.py | https://github.com/colour-science/colour/blob/master/colour/io/tests/test_ctl.py | BSD-3-Clause |
def test_template_ctl_transform_float(self) -> None:
"""Test :func:`colour.io.ctl.template_ctl_transform_float` definition."""
ctl_foo_bar_float = template_ctl_transform_float(
"rIn + foo[0]",
"gIn + foo[1]",
"bIn + foo[2]",
description="Foo & Bar",
... | Test :func:`colour.io.ctl.template_ctl_transform_float` definition. | test_template_ctl_transform_float | python | colour-science/colour | colour/io/tests/test_ctl.py | https://github.com/colour-science/colour/blob/master/colour/io/tests/test_ctl.py | BSD-3-Clause |
def test_template_ctl_transform_float3(self) -> None:
"""Test :func:`colour.io.ctl.template_ctl_transform_float3` definition."""
ctl_foo_bar_float3 = template_ctl_transform_float3(
"baz(rgbIn, foo, bar)",
description="Foo, Bar & Baz",
imports=[
'// im... | Test :func:`colour.io.ctl.template_ctl_transform_float3` definition. | test_template_ctl_transform_float3 | python | colour-science/colour | colour/io/tests/test_ctl.py | https://github.com/colour-science/colour/blob/master/colour/io/tests/test_ctl.py | BSD-3-Clause |
def test_image_specification_OpenImageIO(self) -> None: # pragma: no cover
"""
Test :func:`colour.io.image.image_specification_OpenImageIO`
definition.
"""
from OpenImageIO import HALF # pyright: ignore
compression = Image_Specification_Attribute("Compression", "none"... |
Test :func:`colour.io.image.image_specification_OpenImageIO`
definition.
| test_image_specification_OpenImageIO | python | colour-science/colour | colour/io/tests/test_image.py | https://github.com/colour-science/colour/blob/master/colour/io/tests/test_image.py | BSD-3-Clause |
def test_convert_bit_depth(self) -> None:
"""Test :func:`colour.io.image.convert_bit_depth` definition."""
a = np.around(np.linspace(0, 1, 10) * 255).astype("uint8")
assert convert_bit_depth(a, "uint8").dtype is np.dtype("uint8")
np.testing.assert_equal(convert_bit_depth(a, "uint8"), a)... | Test :func:`colour.io.image.convert_bit_depth` definition. | test_convert_bit_depth | python | colour-science/colour | colour/io/tests/test_image.py | https://github.com/colour-science/colour/blob/master/colour/io/tests/test_image.py | BSD-3-Clause |
def test_read_image_OpenImageIO(self) -> None: # pragma: no cover
"""Test :func:`colour.io.image.read_image_OpenImageIO` definition."""
image = read_image_OpenImageIO(
os.path.join(ROOT_RESOURCES, "CMS_Test_Pattern.exr"),
additional_data=False,
)
assert image.sh... | Test :func:`colour.io.image.read_image_OpenImageIO` definition. | test_read_image_OpenImageIO | python | colour-science/colour | colour/io/tests/test_image.py | https://github.com/colour-science/colour/blob/master/colour/io/tests/test_image.py | BSD-3-Clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.