1616from tidy3d .components .validators import assert_line_or_plane , assert_plane , validate_name_str
1717from tidy3d .constants import EPSILON_0 , FARAD , HENRY , MICROMETER , OHM , fp_eps
1818from tidy3d .exceptions import ValidationError
19- from tidy3d .log import log
2019
21- from .base import Tidy3dBaseModel , cached_property , skip_if_fields_missing
20+ from .base import cached_property , skip_if_fields_missing
2221from .geometry .base import Box , ClipOperation , Geometry , GeometryGroup
2322from .geometry .primitives import Cylinder
2423from .geometry .utils import (
2928 snap_point_to_grid ,
3029)
3130from .geometry .utils_2d import increment_float
31+ from .microwave .base import MicrowaveBaseModel
3232from .microwave .formulas .circuit_parameters import (
3333 capacitance_colinear_cylindrical_wire_segments ,
3434 capacitance_rectangular_sheets ,
5050LOSS_FACTOR_INDUCTOR = 1e6
5151
5252
53- class LumpedElement (Tidy3dBaseModel , ABC ):
53+ class LumpedElement (MicrowaveBaseModel , ABC ):
5454 """Base class describing the interface all lumped elements obey."""
5555
5656 name : str = pd .Field (
@@ -104,14 +104,6 @@ def to_structures(self, grid: Grid = None) -> list[Structure]:
104104 which are ready to be added to the :class:`.Simulation`"""
105105 return [self .to_structure (grid )]
106106
107- @pd .root_validator (pre = False )
108- def _warn_rf_license (cls , values ):
109- log .warning (
110- "ℹ️ ⚠️ RF simulations are subject to new license requirements in the future. You have instantiated at least one RF-specific component." ,
111- log_once = True ,
112- )
113- return values
114-
115107
116108class RectangularLumpedElement (LumpedElement , Box ):
117109 """Class representing a rectangular element with zero thickness. A :class:`RectangularLumpedElement`
@@ -464,7 +456,7 @@ def geometry(self) -> ClipOperation:
464456 return self .to_geometry ()
465457
466458
467- class NetworkConversions (Tidy3dBaseModel ):
459+ class NetworkConversions (MicrowaveBaseModel ):
468460 """Helper functionality for directly computing complex conductivity and permittivities using
469461 equations in _`[1]`. Useful for testing the direct translations of lumped network parameters into
470462 an equivalent PoleResidue medium.
@@ -546,16 +538,8 @@ def complex_permittivity(a: tuple[float, ...], b: tuple[float, ...], freqs: np.n
546538 sigma = NetworkConversions .complex_conductivity (a , b , freqs )
547539 return 1j * sigma / (2 * np .pi * freqs * EPSILON_0 )
548540
549- @pd .root_validator (pre = False )
550- def _warn_rf_license (cls , values ):
551- log .warning (
552- "ℹ️ ⚠️ RF simulations are subject to new license requirements in the future. You have instantiated at least one RF-specific component." ,
553- log_once = True ,
554- )
555- return values
556-
557541
558- class RLCNetwork (Tidy3dBaseModel ):
542+ class RLCNetwork (MicrowaveBaseModel ):
559543 """Class for representing a simple network consisting of a resistor, capacitor, and inductor.
560544 Provides additional functionality for representing the network as an equivalent medium.
561545
@@ -575,7 +559,7 @@ class RLCNetwork(Tidy3dBaseModel):
575559 >>> RL_series = RLCNetwork(resistance=75,
576560 ... inductance=1e-9,
577561 ... network_topology="series"
578- ... ) # doctest: +SKIP
562+ ... )
579563
580564 """
581565
@@ -804,16 +788,8 @@ def _validate_single_element(cls, val, values):
804788 raise ValueError ("At least one element must be defined in the 'RLCNetwork'." )
805789 return val
806790
807- @pd .root_validator (pre = False )
808- def _warn_rf_license (cls , values ):
809- log .warning (
810- "ℹ️ ⚠️ RF simulations are subject to new license requirements in the future. You have instantiated at least one RF-specific component." ,
811- log_once = True ,
812- )
813- return values
814-
815791
816- class AdmittanceNetwork (Tidy3dBaseModel ):
792+ class AdmittanceNetwork (MicrowaveBaseModel ):
817793 """Class for representing a network consisting of an arbitrary number of resistors,
818794 capacitors, and inductors. The network is represented in the Laplace domain
819795 as an admittance function. Provides additional functionality for representing the network
@@ -857,7 +833,7 @@ class AdmittanceNetwork(Tidy3dBaseModel):
857833 >>> b = (R, 0)
858834 >>> RC_parallel = AdmittanceNetwork(a=a,
859835 ... b=b
860- ... ) # doctest: +SKIP
836+ ... )
861837
862838 """
863839
@@ -889,14 +865,6 @@ def _as_admittance_function(self) -> tuple[tuple[float, ...], tuple[float, ...]]
889865 """
890866 return (self .a , self .b )
891867
892- @pd .root_validator (pre = False )
893- def _warn_rf_license (cls , values ):
894- log .warning (
895- "ℹ️ ⚠️ RF simulations are subject to new license requirements in the future. You have instantiated at least one RF-specific component." ,
896- log_once = True ,
897- )
898- return values
899-
900868
901869class LinearLumpedElement (RectangularLumpedElement ):
902870 """Lumped element representing a network consisting of resistors, capacitors, and inductors.
@@ -919,14 +887,14 @@ class LinearLumpedElement(RectangularLumpedElement):
919887 >>> RL_series = RLCNetwork(resistance=75,
920888 ... inductance=1e-9,
921889 ... network_topology="series"
922- ... ) # doctest: +SKIP
890+ ... )
923891 >>> linear_element = LinearLumpedElement(
924892 ... center=[0, 0, 0],
925893 ... size=[2, 0, 3],
926894 ... voltage_axis=0,
927895 ... network=RL_series,
928896 ... name="LumpedRL"
929- ... ) # doctest: +SKIP
897+ ... )
930898
931899
932900 See Also
0 commit comments