Skip to content

Commit

Permalink
Merge branch 'feature/v0.4.3' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Mar 14, 2023
2 parents 35424bc + 8195d51 commit 447bce6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
12 changes: 5 additions & 7 deletions colour/quality/ssi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
-------
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions colour/quality/tests/test_ssi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 447bce6

Please sign in to comment.