Coverage for colour/plotting/tm3018/tests/test_components.py: 100%
49 statements
« prev ^ index » next coverage.py v7.11.0, created at 2025-11-15 19:01 +1300
« prev ^ index » next coverage.py v7.11.0, created at 2025-11-15 19:01 +1300
1"""Define the unit tests for the :mod:`colour.plotting.tm3018.components` module."""
3from __future__ import annotations
5from matplotlib.axes import Axes
6from matplotlib.figure import Figure
8from colour.colorimetry import SDS_ILLUMINANTS
9from colour.plotting.tm3018.components import (
10 plot_16_bin_bars,
11 plot_colour_fidelity_indexes,
12 plot_colour_vector_graphic,
13 plot_local_chroma_shifts,
14 plot_local_colour_fidelities,
15 plot_local_hue_shifts,
16 plot_spectra_ANSIIESTM3018,
17)
18from colour.quality import (
19 colour_fidelity_index_ANSIIESTM3018,
20)
22__author__ = "Colour Developers"
23__copyright__ = "Copyright 2013 Colour Developers"
24__license__ = "BSD-3-Clause - https://opensource.org/licenses/BSD-3-Clause"
25__maintainer__ = "Colour Developers"
26__email__ = "colour-developers@colour-science.org"
27__status__ = "Production"
29__all__ = [
30 "TestPlotSpectraANSIIESTM3018",
31 "TestPlotColourVectorGraphic",
32 "TestPlot16BinBars",
33 "TestPlotLocalChromaShifts",
34 "TestPlotLocalHueShifts",
35 "TestPlotLocalColourFidelities",
36 "TestPlotColourFidelityIndexes",
37]
39SPECIFICATION_ANSIIESTM3018 = colour_fidelity_index_ANSIIESTM3018(
40 SDS_ILLUMINANTS["FL2"], True
41)
44class TestPlotSpectraANSIIESTM3018:
45 """
46 Define :func:`colour.plotting.tm3018.components.
47 plot_spectra_ANSIIESTM3018` definition unit tests methods.
48 """
50 def test_plot_spectra_ANSIIESTM3018(self) -> None:
51 """
52 Test :func:`colour.plotting.tm3018.components.\
53plot_spectra_ANSIIESTM3018` definition.
54 """
56 figure, axes = plot_spectra_ANSIIESTM3018(SPECIFICATION_ANSIIESTM3018)
58 assert isinstance(figure, Figure)
59 assert isinstance(axes, Axes)
62class TestPlotColourVectorGraphic:
63 """
64 Define :func:`colour.plotting.tm3018.components.\
65plot_colour_vector_graphic` definition unit tests methods.
66 """
68 def test_plot_colour_vector_graphic(self) -> None:
69 """
70 Test :func:`colour.plotting.tm3018.components.\
71plot_colour_vector_graphic` definition.
72 """
74 figure, axes = plot_colour_vector_graphic(SPECIFICATION_ANSIIESTM3018)
76 assert isinstance(figure, Figure)
77 assert isinstance(axes, Axes)
80class TestPlot16BinBars:
81 """
82 Define :func:`colour.plotting.tm3018.components.plot_16_bin_bars`
83 definition unit tests methods.
84 """
86 def test_plot_16_bin_bars(self) -> None:
87 """
88 Test :func:`colour.plotting.tm3018.components.plot_16_bin_bars`
89 definition.
90 """
92 figure, axes = plot_16_bin_bars(range(16), "{0}")
94 assert isinstance(figure, Figure)
95 assert isinstance(axes, Axes)
98class TestPlotLocalChromaShifts:
99 """
100 Define :func:`colour.plotting.tm3018.components.plot_local_chroma_shifts`
101 definition unit tests methods.
102 """
104 def test_plot_local_chroma_shifts(self) -> None:
105 """
106 Test :func:`colour.plotting.tm3018.components.\
107plot_local_chroma_shifts` definition.
108 """
110 figure, axes = plot_local_chroma_shifts(SPECIFICATION_ANSIIESTM3018)
112 assert isinstance(figure, Figure)
113 assert isinstance(axes, Axes)
116class TestPlotLocalHueShifts:
117 """
118 Define :func:`colour.plotting.tm3018.components.plot_local_hue_shifts`
119 definition unit tests methods.
120 """
122 def test_plot_local_hue_shifts(self) -> None:
123 """
124 Test :func:`colour.plotting.tm3018.components.\
125plot_local_hue_shifts` definition.
126 """
128 figure, axes = plot_local_hue_shifts(SPECIFICATION_ANSIIESTM3018)
130 assert isinstance(figure, Figure)
131 assert isinstance(axes, Axes)
134class TestPlotLocalColourFidelities:
135 """
136 Define :func:`colour.plotting.tm3018.components.
137 plot_local_colour_fidelities` definition unit tests methods.
138 """
140 def test_plot_local_colour_fidelities(self) -> None:
141 """
142 Test :func:`colour.plotting.tm3018.components.\
143plot_local_colour_fidelities` definition.
144 """
146 figure, axes = plot_local_colour_fidelities(SPECIFICATION_ANSIIESTM3018)
148 assert isinstance(figure, Figure)
149 assert isinstance(axes, Axes)
152class TestPlotColourFidelityIndexes:
153 """
154 Define :func:`colour.plotting.tm3018.components.\
155plot_colour_fidelity_indexes` definition unit tests methods.
156 """
158 def test_plot_colour_fidelity_indexes(self) -> None:
159 """
160 Test :func:`colour.plotting.tm3018.components.\
161plot_colour_fidelity_indexes` definition.
162 """
164 figure, axes = plot_colour_fidelity_indexes(SPECIFICATION_ANSIIESTM3018)
166 assert isinstance(figure, Figure)
167 assert isinstance(axes, Axes)