Skip to content

Commit 7464a49

Browse files
weiliangjin2021daquinteroflex
authored andcommitted
fix(tidy3d): FXC-5313 improve broadband frequency range warning message
1 parent 172f89e commit 7464a49

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

tests/test_components/test_source.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def test_gaussian_from_frequency_range():
133133
g2 = td.GaussianPulse.from_frequency_range(fmin=fmin, fmax=fmax)
134134
assert g2.remove_dc_component
135135

136-
with AssertLogLevel("WARNING", contains_str="not sufficiently large"):
136+
with AssertLogLevel("WARNING", contains_str="broadband"):
137137
g_small = td.GaussianPulse.from_frequency_range(
138138
fmin=fmin, fmax=60e9, remove_dc_component=True
139139
)

tidy3d/components/source/time.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,8 @@ def from_frequency_range(
389389
pulse = cls(freq0=freq0, fwidth=fwidth, **kwargs)
390390
if np.abs(pulse._rel_amp_freq(fmin)) < WARN_SOURCE_AMPLITUDE:
391391
log.warning(
392-
"Source amplitude is not sufficiently large throughout the specified frequency range, "
393-
"which can result in inaccurate simulation results. Please decrease the frequency range.",
392+
"Default source time profile is less accurate for the specified broadband frequency range. "
393+
"For more accurate results, consider reducing the frequency range or using a 'BroadbandSource'.",
394394
)
395395
return pulse
396396

0 commit comments

Comments
 (0)