Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/api/microwave/component_modeler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ TerminalComponentModeler
:toctree: ../_autosummary/
:template: module.rst

tidy3d.plugins.smatrix.TerminalComponentModeler
tidy3d.plugins.smatrix.TerminalComponentModelerData
tidy3d.plugins.smatrix.MicrowaveSMatrixData
tidy3d.plugins.smatrix.TerminalPortDataArray
tidy3d.plugins.smatrix.PortDataArray
tidy3d.rf.TerminalComponentModeler
tidy3d.rf.TerminalComponentModelerData
tidy3d.rf.MicrowaveSMatrixData
tidy3d.rf.TerminalPortDataArray
tidy3d.rf.PortDataArray

The :class:`.TerminalComponentModeler` is the core simulation object for 3D RF/microwave simulations in Tidy3D. Its primary function is to simulate the system over ``N`` number of ports and ``M`` number of frequency points, with the end result being a ``MxNxN`` S-parameter matrix.

Expand Down
2 changes: 1 addition & 1 deletion docs/api/microwave/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Overview

.. warning::

RF simulations will be subject to new license requirements in the future.
RF simulations and functionality will require new license requirements in an upcoming release. All RF-specific classes are now available within the sub-package 'tidy3d.rf'.

.. warning::

Expand Down
6 changes: 3 additions & 3 deletions docs/api/microwave/material.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ RF Materials Models
tidy3d.PECMedium
tidy3d.PMCMedium
tidy3d.LossyMetalMedium
tidy3d.SurfaceImpedanceFitterParam
tidy3d.HammerstadSurfaceRoughness
tidy3d.HuraySurfaceRoughness
tidy3d.rf.SurfaceImpedanceFitterParam
tidy3d.rf.HammerstadSurfaceRoughness
tidy3d.rf.HuraySurfaceRoughness

The :class:`.PECMedium` and :class:`.LossyMetalMedium` classes can be used to model metallic materials.

Expand Down
14 changes: 7 additions & 7 deletions docs/api/microwave/ports/lumped.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Lumped Port & Elements
:toctree: ../_autosummary/
:template: module.rst

tidy3d.plugins.smatrix.LumpedPort
tidy3d.plugins.smatrix.CoaxialLumpedPort
tidy3d.rf.LumpedPort
tidy3d.rf.CoaxialLumpedPort

The :class:`LumpedPort` feature represents a planar, uniform current excitation with a fixed impedance termination.

Expand Down Expand Up @@ -52,11 +52,11 @@ The ``CoaxialLumpedPort`` represents an analytical coaxial field source.
:toctree: ../_autosummary/
:template: module.rst

tidy3d.LumpedResistor
tidy3d.CoaxialLumpedResistor
tidy3d.LinearLumpedElement
tidy3d.RLCNetwork
tidy3d.AdmittanceNetwork
tidy3d.rf.LumpedResistor
tidy3d.rf.CoaxialLumpedResistor
tidy3d.rf.LinearLumpedElement
tidy3d.rf.RLCNetwork
tidy3d.rf.AdmittanceNetwork

For a simple resistive lumped element, use ``LumpedResistor``.

Expand Down
18 changes: 9 additions & 9 deletions docs/api/microwave/ports/wave.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Wave Port
:toctree: ../_autosummary/
:template: module.rst

tidy3d.plugins.smatrix.WavePort
tidy3d.ModeSpec
tidy3d.rf.WavePort
tidy3d.rf.MicrowaveModeSpec

The :class:`.WavePort` represents a modal source port. The port mode is first calculated in the 2D mode solver, then injected into the 3D simulation. The :class:`.WavePort` is also automatically terminated with a modal absorbing boundary :class:`.ModeABCBoundary` that perfectly absorbs the outgoing mode. Any non-matching modes are subject to PEC reflection.

Expand Down Expand Up @@ -46,13 +46,13 @@ If it is desired to only solve for the 2D port mode, one can use the ``to_mode_s
:toctree: ../_autosummary/
:template: module.rst

tidy3d.plugins.microwave.AxisAlignedVoltageIntegral
tidy3d.plugins.microwave.AxisAlignedCurrentIntegral
tidy3d.plugins.microwave.Custom2DVoltageIntegral
tidy3d.plugins.microwave.Custom2DCurrentIntegral
tidy3d.plugins.microwave.AxisAlignedPathIntegral
tidy3d.plugins.microwave.Custom2DPathIntegral
tidy3d.plugins.microwave.ImpedanceCalculator
tidy3d.rf.AxisAlignedVoltageIntegral
tidy3d.rf.AxisAlignedCurrentIntegral
tidy3d.rf.Custom2DVoltageIntegral
tidy3d.rf.Custom2DCurrentIntegral
tidy3d.rf.AxisAlignedPathIntegral
tidy3d.rf.Custom2DPathIntegral
tidy3d.rf.ImpedanceCalculator

The classes above are used to define the voltage/current integration paths for impedance calculation.

Expand Down
10 changes: 5 additions & 5 deletions docs/api/microwave/radiation_scattering.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ Radiation & Scattering
:toctree: ../_autosummary/
:template: module.rst

tidy3d.DirectivityMonitor
tidy3d.plugins.smatrix.DirectivityMonitorSpec
tidy3d.plugins.microwave.RectangularAntennaArrayCalculator
tidy3d.plugins.microwave.LobeMeasurer
tidy3d.AntennaMetricsData
tidy3d.rf.DirectivityMonitor
tidy3d.rf.DirectivityMonitorSpec
tidy3d.rf.RectangularAntennaArrayCalculator
tidy3d.rf.LobeMeasurer
tidy3d.rf.AntennaMetricsData

When modeling antennas or scattering problems, it is vital to analyze the radiated far-field. For such applications, the :class:`.DirectivityMonitor` should be used.

Expand Down
2 changes: 1 addition & 1 deletion docs/api/plugins/microwave.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Microwave

.. warning::

RF simulations are subject to new license requirements in the future. These components are within the RF scope.
RF simulations and functionality will require new license requirements in an upcoming release. All RF-specific classes are now available within the sub-package 'tidy3d.rf'. These classes are included.


.. autosummary::
Expand Down
2 changes: 1 addition & 1 deletion docs/api/plugins/smatrix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ S-Matrix Component Modelers Plugin

.. seealso::

For classes related to microwave/RF modeling, please refer to the main `Microwave and RF <../microwave/index.html>`_ page.
For classes related to microwave/RF modeling, please refer to the main `Microwave and RF <../microwave/index.html>`_ page and `tidy3d.rf` sub-package.


.. warning::
Expand Down
21 changes: 0 additions & 21 deletions tidy3d/components/microwave/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,15 @@

from __future__ import annotations

import pydantic.v1 as pd

from tidy3d.components.base import Tidy3dBaseModel
from tidy3d.config import config
from tidy3d.log import log


class MicrowaveBaseModel(Tidy3dBaseModel):
"""Base model that all RF and microwave specific components inherit from."""

@pd.root_validator(pre=False)
def _warn_rf_license(cls, values):
from tidy3d.config import config

# Skip warning when globally suppressed via config
if not config.microwave.suppress_rf_license_warning:
log.warning(
"ℹ️ ⚠️ RF simulations are subject to new license requirements in the future. "
"You have instantiated at least one RF-specific component.",
log_once=True,
)
return values

@classmethod
def _default_without_license_warning(cls) -> MicrowaveBaseModel:
"""Internal helper factory function for classes inheriting from ``MicrowaveBaseModel``."""
if config.microwave.suppress_rf_license_warning is True:
return cls()
else:
config.microwave.suppress_rf_license_warning = True
default_constructed = cls()
config.microwave.suppress_rf_license_warning = False
return default_constructed
2 changes: 1 addition & 1 deletion tidy3d/components/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4282,7 +4282,7 @@ def _warn_rf_license(self) -> None:

# issue warning
if rf_component_breakdown_msg != "":
msg = " ℹ️ ⚠️ RF simulations are subject to new license requirements in the future. You are using RF-specific components in this simulation."
msg = "RF simulations and functionality will require new license requirements in an upcoming release. All RF-specific classes are now available within the sub-package 'tidy3d.rf'."
msg += rf_component_breakdown_msg
log.warning(msg, log_once=True)

Expand Down
14 changes: 7 additions & 7 deletions tidy3d/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,13 @@ def _log(
) -> None:
"""Distribute log messages to all handlers"""

# Check global cache if requested (before composing/capturing to avoid duplicates)
if log_once:
# Use the message body before composition as key
if message in self._static_cache:
return
self._static_cache.add(message)

# Compose message
if len(args) > 0:
try:
Expand All @@ -267,13 +274,6 @@ def _log(
custom_loc = []
self._stack[-1]["messages"].append((level_name, composed_message, custom_loc))

# Check global cache if requested
if log_once:
# Use the message body before composition as key
if message in self._static_cache:
return
self._static_cache.add(message)

# Context-local logger emits a single message and consolidates the rest
if self._counts is not None:
if len(self._counts) > 0:
Expand Down
2 changes: 1 addition & 1 deletion tidy3d/plugins/smatrix/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# Instantiate on plugin import till we unite with toplevel
warnings.filterwarnings(
"once",
message="ℹ️ ⚠️ RF simulations are subject to new license requirements in the future. You have instantiated at least one RF-specific component.",
message="RF simulations and functionality will require new license requirements in an upcoming release. All RF-specific classes are now available within the sub-package 'tidy3d.rf'.",
category=FutureWarning,
)

Expand Down
8 changes: 8 additions & 0 deletions tidy3d/plugins/smatrix/component_modelers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ class AbstractComponentModeler(ABC, Tidy3dBaseModel):
"Otherwise, a default source time will be constructed.",
)

@pd.root_validator(pre=False)
def _warn_refactor_2_10(cls, values):
log.warning(
f"'{cls.__name__}' was refactored (tidy3d 'v2.10.0'). Existing functionality is available differently. Please consult the migration documentation: https://docs.flexcompute.com/projects/tidy3d/en/latest/api/microwave/microwave_migration.html",
log_once=True,
)
return values

@pd.validator("simulation", always=True)
def _sim_has_no_sources(cls, val):
"""Make sure simulation has no sources as they interfere with tool."""
Expand Down
8 changes: 0 additions & 8 deletions tidy3d/plugins/smatrix/component_modelers/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,6 @@ class TerminalComponentModeler(AbstractComponentModeler, MicrowaveBaseModel):
description="The low frequency smoothing parameters for the terminal component simulation.",
)

@pd.root_validator(pre=False)
def _warn_refactor_2_10(cls, values):
log.warning(
f"ℹ️ ⚠️ The {cls.__name__} class was refactored in tidy3d version 2.10. Migration documentation will be provided, and existing functionality can be accessed in a different way.",
log_once=True,
)
return values

@property
def _sim_with_sources(self) -> Simulation:
"""Instance of :class:`.Simulation` with all sources and absorbers added for each port, for plotting."""
Expand Down
9 changes: 0 additions & 9 deletions tidy3d/plugins/smatrix/data/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from tidy3d.components.microwave.base import MicrowaveBaseModel
from tidy3d.components.microwave.data.monitor_data import AntennaMetricsData
from tidy3d.constants import C_0
from tidy3d.log import log
from tidy3d.plugins.smatrix.component_modelers.terminal import TerminalComponentModeler
from tidy3d.plugins.smatrix.data.base import AbstractComponentModelerData
from tidy3d.plugins.smatrix.data.data_array import (
Expand Down Expand Up @@ -227,14 +226,6 @@ def smatrix_deembedded(self, port_shifts: np.ndarray = None) -> MicrowaveSMatrix
"""Interface function returns de-embedded S-parameter matrix."""
return self.change_port_reference_planes(self.smatrix(), port_shifts=port_shifts)

@pd.root_validator(pre=False)
def _warn_rf_license(cls, values):
log.warning(
"ℹ️ ⚠️ RF simulations are subject to new license requirements in the future. You have instantiated at least one RF-specific component.",
log_once=True,
)
return values

def _monitor_data_at_port_amplitude(
self,
port_index: NetworkIndex,
Expand Down
2 changes: 1 addition & 1 deletion tidy3d/rf.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
# Instantiate on plugin import till we unite with toplevel
warnings.filterwarnings(
"once",
message="ℹ️ ⚠️ RF simulations are subject to new license requirements in the future. You have instantiated at least one RF-specific component.",
message="RF simulations and functionality will require new license requirements in an upcoming release. All RF-specific classes are now available within the sub-package 'tidy3d.rf'.",
category=FutureWarning,
)

Expand Down