From 8195d5198ab9e93d50b83e64b4ce050f223c9cbd Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Tue, 14 Mar 2023 21:27:01 +1300 Subject: [PATCH] Make`colour.spectral_similarity_index` definition `round_results` argument singular, i.e. `round_result`. --- colour/quality/ssi.py | 12 +++++------- colour/quality/tests/test_ssi.py | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/colour/quality/ssi.py b/colour/quality/ssi.py index fb1fb6f5be..bc8a0e1a8a 100644 --- a/colour/quality/ssi.py +++ b/colour/quality/ssi.py @@ -46,7 +46,7 @@ def spectral_similarity_index( sd_test: SpectralDistribution, sd_reference: SpectralDistribution, - round_results: bool = True, + round_result: bool = True, ) -> NDArrayFloat: """ Return the *Academy Spectral Similarity Index* (SSI) of given test @@ -58,9 +58,9 @@ def spectral_similarity_index( Test spectral distribution. sd_reference Reference spectral distribution. - round_results - Controls rounding the results. Particularly useful when using SSI in an - optimization routine. Default True. + round_result + Whether to round the result/output. This is particularly useful when + using SSI in an optimization routine. Default is *True*. Returns ------- @@ -150,6 +150,4 @@ def spectral_similarity_index( SSI = 100 - 32 * np.sqrt(m_v) - if round_results: - return np.around(SSI) - return SSI + return np.around(SSI) if round_result else SSI diff --git a/colour/quality/tests/test_ssi.py b/colour/quality/tests/test_ssi.py index 36c366e6bc..a4cd1ff17b 100644 --- a/colour/quality/tests/test_ssi.py +++ b/colour/quality/tests/test_ssi.py @@ -587,7 +587,7 @@ def test_spectral_similarity_rounding(self): spectral_similarity_index( SDS_ILLUMINANTS["C"], SDS_ILLUMINANTS["D65"], - round_results=False, + round_result=False, ), 94.178, places=2, @@ -596,7 +596,7 @@ def test_spectral_similarity_rounding(self): spectral_similarity_index( SpectralDistribution(DATA_HMI), SDS_ILLUMINANTS["D50"], - round_results=False, + round_result=False, ), 71.772, places=2,