File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed
Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 4646def 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
Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments