Skip to content

Commit

Permalink
Fix comments + one test
Browse files Browse the repository at this point in the history
  • Loading branch information
ansaminard committed Dec 9, 2024
1 parent e188f84 commit ea8c0ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/ansys/sound/core/sound_composer/source_broadband_noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def source_bbn(self) -> FieldsContainer:
"""Broadband noise source data, as a DPF fields container.
The broadband noise source data consists of a series of spectra, each corresponding to a
control parameter value. Spectra can be narrowband, PSD, octave-band levels, or
control parameter value. Spectra can be narrowband (in dB or dB/Hz), octave-band levels, or
1/3-octave-band levels.
"""
return self.__source_bbn
Expand Down Expand Up @@ -170,10 +170,10 @@ def source_bbn(self, source_bbn: FieldsContainer):
support_data = source_bbn.get_support("control_parameter_1")
support_properties = support_data.available_field_supported_properties()
support_values = support_data.field_support_by_property(support_properties[0])
if len(support_values) < 1:
if len(support_values) != len(source_bbn):
raise PyAnsysSoundException(
"Control data in the specified broadband noise source must contain at least "
"one element."
"Broadband noise source must contain the same number of spectra and "
"associated control parameter values."
)

self.__source_bbn = source_bbn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ def test_source_broadband_noise_properties_exceptions(dpf_sound_test_server):
with pytest.raises(
PyAnsysSoundException,
match=(
"Control data in the specified broadband noise source must contain at least one "
"element."
"Broadband noise source must contain the same number of spectra and associated "
"control parameter values."
),
):
source_bbn_obj.source_bbn = fc_source_bbn
Expand Down

0 comments on commit ea8c0ad

Please sign in to comment.