File tree 2 files changed +7
-9
lines changed
2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 46
46
def spectral_similarity_index (
47
47
sd_test : SpectralDistribution ,
48
48
sd_reference : SpectralDistribution ,
49
- round_results : bool = True ,
49
+ round_result : bool = True ,
50
50
) -> NDArrayFloat :
51
51
"""
52
52
Return the *Academy Spectral Similarity Index* (SSI) of given test
@@ -58,9 +58,9 @@ def spectral_similarity_index(
58
58
Test spectral distribution.
59
59
sd_reference
60
60
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* .
64
64
65
65
Returns
66
66
-------
@@ -150,6 +150,4 @@ def spectral_similarity_index(
150
150
151
151
SSI = 100 - 32 * np .sqrt (m_v )
152
152
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):
587
587
spectral_similarity_index (
588
588
SDS_ILLUMINANTS ["C" ],
589
589
SDS_ILLUMINANTS ["D65" ],
590
- round_results = False ,
590
+ round_result = False ,
591
591
),
592
592
94.178 ,
593
593
places = 2 ,
@@ -596,7 +596,7 @@ def test_spectral_similarity_rounding(self):
596
596
spectral_similarity_index (
597
597
SpectralDistribution (DATA_HMI ),
598
598
SDS_ILLUMINANTS ["D50" ],
599
- round_results = False ,
599
+ round_result = False ,
600
600
),
601
601
71.772 ,
602
602
places = 2 ,
You can’t perform that action at this time.
0 commit comments