Skip to content

Commit 11ae8a3

Browse files
docs: add FreqRange, FrequencyUtils, frequencies and wavelengths to utilities.rst
1 parent 09c7974 commit 11ae8a3

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

docs/api/utils.rst renamed to docs/api/utilities.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ Utilities
99

1010
tidy3d.RunTimeSpec
1111
tidy3d.FreqRange
12-
tidy3d.FreqUtils
12+
tidy3d.FrequencyUtils
1313
tidy3d.frequencies
1414
tidy3d.wavelengths

tidy3d/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@
208208
from .components.field_projection import FieldProjector
209209

210210
# frequency conversion utilities
211-
from .components.frequencies import FreqRange, frequencies, wavelengths
211+
from .components.frequencies import FreqRange, FrequencyUtils, frequencies, wavelengths
212212

213213
# geometry
214214
from .components.geometry.base import Box, ClipOperation, Geometry, GeometryGroup, Transformed
@@ -544,6 +544,7 @@ def set_logging_level(level: str) -> None:
544544
"FluxTimeMonitor",
545545
"FossumCarrierLifetime",
546546
"FreqRange",
547+
"FrequencyUtils",
547548
"FullyAnisotropicMedium",
548549
"GaussianBeam",
549550
"GaussianBeamProfile",

tidy3d/components/frequencies.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121

2222
class FrequencyUtils(Tidy3dBaseModel):
23-
"""Class for general frequency/wavelength utilities."""
23+
"""Utilities for classifying frequencies/wavelengths and generating samples for standard optical bands."""
2424

2525
use_wavelength: bool = pd.Field(
2626
False,
@@ -235,6 +235,16 @@ def u_band(self, n: int = 11) -> list[float]:
235235
frequencies = FrequencyUtils(use_wavelength=False)
236236
wavelengths = FrequencyUtils(use_wavelength=True)
237237

238+
frequencies.__doc__ = (
239+
"Frequency utilities configured to interpret and return values in hertz (Hz). "
240+
"Use for RF, microwave, optical, and other band classifications in frequency units."
241+
)
242+
243+
wavelengths.__doc__ = (
244+
"Frequency utilities configured to interpret and return values in micrometers (μm). "
245+
"Use for optical and photonic calculations where wavelength units are preferred."
246+
)
247+
238248

239249
class FreqRange(Tidy3dBaseModel):
240250
"""

0 commit comments

Comments
 (0)