Coverage for difference/tests/test_huang2015.py: 100%

1"""Define the unit tests for the :mod:`colour.difference.huang2015` module."""

2

3 from __future__ import annotations

4

5 import numpy as np

6

7 from colour.constants import TOLERANCE_ABSOLUTE_TESTS

8 from colour.difference import power_function_Huang2015

9

10 __author__ = "Colour Developers"

11 __copyright__ = "Copyright 2013 Colour Developers"

12 __license__ = "BSD-3-Clause - https://opensource.org/licenses/BSD-3-Clause"

13 __maintainer__ = "Colour Developers"

14 __email__ = "colour-developers@colour-science.org"

15 __status__ = "Production"

16

17 __all__ = [

18 "TestPowerFunctionHuang2015",

19]

20

21

22 class TestPowerFunctionHuang2015:

23 """

24 Define :func:`colour.difference.huang2015.power_function_Huang2015`

25 definition unit tests methods.

26 """

27

28 def test_power_function_Huang2015(self) -> None:

29 """

30 Test :func:`colour.difference.huang2015.power_function_Huang2015`

31 definition.

32 """

33

34 d_E = np.array([2.0425, 2.8615, 3.4412])

35

36 np.testing.assert_allclose(

37 power_function_Huang2015(d_E),

38 np.array([2.35748796, 2.98505036, 3.39651062]),

39 atol=TOLERANCE_ABSOLUTE_TESTS,

40 )