Skip to content

Commit e4908a3

Browse files
committed
tests: CRI: Test all calculated data
Currently the CRI test function only tests a subset of the calculated data. The attribute `Q_a` and the colorimetry data are not tested, although the reference data object has reference values. This patch adds the missing tests. Signed-off-by: Christoph Müllner <[email protected]>
1 parent a043551 commit e4908a3

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

colour/quality/tests/test_cri.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,32 @@ def test_colour_rendering_index(self) -> None:
339339
SDS_ILLUMINANTS["FL1"], additional_data=True
340340
)
341341

342+
np.testing.assert_allclose(
343+
specification_r.Q_a, specification_t.Q_a, atol=TOLERANCE_ABSOLUTE_TESTS
344+
)
345+
342346
np.testing.assert_allclose(
343347
[data.Q_a for _index, data in sorted(specification_r.Q_as.items())],
344348
[data.Q_a for _index, data in sorted(specification_t.Q_as.items())],
345349
atol=TOLERANCE_ABSOLUTE_TESTS,
346350
)
351+
352+
np.testing.assert_allclose(
353+
[
354+
v
355+
for s in specification_r.colorimetry_data
356+
for tcs in s
357+
for arr in [getattr(tcs, k) for k in ["XYZ", "uv", "UVW"]]
358+
if isinstance(arr, np.ndarray)
359+
for v in arr
360+
],
361+
[
362+
v
363+
for s in specification_t.colorimetry_data
364+
for tcs in s
365+
for arr in [getattr(tcs, k) for k in ["XYZ", "uv", "UVW"]]
366+
if isinstance(arr, np.ndarray)
367+
for v in arr
368+
],
369+
atol=TOLERANCE_ABSOLUTE_TESTS,
370+
)

0 commit comments

Comments
 (0)