99import numpy as np
1010import pydantic .v1 as pd
1111
12+ from tidy3d .log import log
13+
1214from ..components .grid .grid import Grid
1315from ..components .medium import (
1416 PEC2D ,
@@ -110,6 +112,14 @@ def to_structures(self, grid: Grid = None) -> list[Structure]:
110112 which are ready to be added to the :class:`.Simulation`"""
111113 return [self .to_structure (grid )]
112114
115+ @pd .root_validator (pre = False )
116+ def _warn_rf_license (cls , values ):
117+ log .warning (
118+ "ℹ️ ⚠️ RF simulations are subject to new license requirements in the future. You are have instantiated at least one RF-specific component." ,
119+ log_once = True ,
120+ )
121+ return values
122+
113123
114124class RectangularLumpedElement (LumpedElement , Box ):
115125 """Class representing a rectangular element with zero thickness. A :class:`RectangularLumpedElement`
@@ -543,6 +553,14 @@ def complex_permittivity(a: tuple[float, ...], b: tuple[float, ...], freqs: np.n
543553 sigma = NetworkConversions .complex_conductivity (a , b , freqs )
544554 return 1j * sigma / (2 * np .pi * freqs * EPSILON_0 )
545555
556+ @pd .root_validator (pre = False )
557+ def _warn_rf_license (cls , values ):
558+ log .warning (
559+ "ℹ️ ⚠️ RF simulations are subject to new license requirements in the future. You are have instantiated at least one RF-specific component." ,
560+ log_once = True ,
561+ )
562+ return values
563+
546564
547565class RLCNetwork (Tidy3dBaseModel ):
548566 """Class for representing a simple network consisting of a resistor, capacitor, and inductor.
@@ -564,7 +582,7 @@ class RLCNetwork(Tidy3dBaseModel):
564582 >>> RL_series = RLCNetwork(resistance=75,
565583 ... inductance=1e-9,
566584 ... network_topology="series"
567- ... )
585+ ... ) # doctest: +SKIP
568586
569587 """
570588
@@ -794,6 +812,14 @@ def _validate_single_element(cls, val, values):
794812 raise ValueError ("At least one element must be defined in the 'RLCNetwork'." )
795813 return val
796814
815+ @pd .root_validator (pre = False )
816+ def _warn_rf_license (cls , values ):
817+ log .warning (
818+ "ℹ️ ⚠️ RF simulations are subject to new license requirements in the future. You are have instantiated at least one RF-specific component." ,
819+ log_once = True ,
820+ )
821+ return values
822+
797823
798824class AdmittanceNetwork (Tidy3dBaseModel ):
799825 """Class for representing a network consisting of an arbitrary number of resistors,
@@ -839,7 +865,7 @@ class AdmittanceNetwork(Tidy3dBaseModel):
839865 >>> b = (R, 0)
840866 >>> RC_parallel = AdmittanceNetwork(a=a,
841867 ... b=b
842- ... )
868+ ... ) # doctest: +SKIP
843869
844870 """
845871
@@ -871,6 +897,14 @@ def _as_admittance_function(self) -> tuple[tuple[float, ...], tuple[float, ...]]
871897 """
872898 return (self .a , self .b )
873899
900+ @pd .root_validator (pre = False )
901+ def _warn_rf_license (cls , values ):
902+ log .warning (
903+ "ℹ️ ⚠️ RF simulations are subject to new license requirements in the future. You are have instantiated at least one RF-specific component." ,
904+ log_once = True ,
905+ )
906+ return values
907+
874908
875909class LinearLumpedElement (RectangularLumpedElement ):
876910 """Lumped element representing a network consisting of resistors, capacitors, and inductors.
@@ -893,14 +927,15 @@ class LinearLumpedElement(RectangularLumpedElement):
893927 >>> RL_series = RLCNetwork(resistance=75,
894928 ... inductance=1e-9,
895929 ... network_topology="series"
896- ... )
930+ ... ) # doctest: +SKIP
897931 >>> linear_element = LinearLumpedElement(
898932 ... center=[0, 0, 0],
899933 ... size=[2, 0, 3],
900934 ... voltage_axis=0,
901935 ... network=RL_series,
902936 ... name="LumpedRL"
903- ... )
937+ ... ) # doctest: +SKIP
938+
904939
905940 See Also
906941 --------
0 commit comments