Skip to content

Commit 447bce6

Browse files
committed
Merge branch 'feature/v0.4.3' into develop
2 parents 35424bc + 8195d51 commit 447bce6

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

colour/quality/ssi.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
def spectral_similarity_index(
4747
sd_test: SpectralDistribution,
4848
sd_reference: SpectralDistribution,
49-
round_results: bool = True,
49+
round_result: bool = True,
5050
) -> NDArrayFloat:
5151
"""
5252
Return the *Academy Spectral Similarity Index* (SSI) of given test
@@ -58,9 +58,9 @@ def spectral_similarity_index(
5858
Test spectral distribution.
5959
sd_reference
6060
Reference spectral distribution.
61-
round_results
62-
Controls rounding the results. Particularly useful when using SSI in an
63-
optimization routine. Default True.
61+
round_result
62+
Whether to round the result/output. This is particularly useful when
63+
using SSI in an optimization routine. Default is *True*.
6464
6565
Returns
6666
-------
@@ -150,6 +150,4 @@ def spectral_similarity_index(
150150

151151
SSI = 100 - 32 * np.sqrt(m_v)
152152

153-
if round_results:
154-
return np.around(SSI)
155-
return SSI
153+
return np.around(SSI) if round_result else SSI

colour/quality/tests/test_ssi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ def test_spectral_similarity_rounding(self):
587587
spectral_similarity_index(
588588
SDS_ILLUMINANTS["C"],
589589
SDS_ILLUMINANTS["D65"],
590-
round_results=False,
590+
round_result=False,
591591
),
592592
94.178,
593593
places=2,
@@ -596,7 +596,7 @@ def test_spectral_similarity_rounding(self):
596596
spectral_similarity_index(
597597
SpectralDistribution(DATA_HMI),
598598
SDS_ILLUMINANTS["D50"],
599-
round_results=False,
599+
round_result=False,
600600
),
601601
71.772,
602602
places=2,

0 commit comments

Comments
 (0)