Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
1,946 changes: 1,147 additions & 799 deletions poetry.lock

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,16 @@ dev = [
'cma',
'diff-cover'
]
tests-only = [
'pytest',
'pytest-timeout',
'pytest-xdist',
'pytest-env',
'pytest-cov',
'psutil',
'ruff',
'diff-cover'
]
docs = [
"jupyter",
"jinja2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import tidy3d as td
from tidy3d.components.data.data_array import FreqDataArray
from tidy3d.components.microwave.ports.base_lumped import AbstractLumpedPort
from tidy3d.exceptions import SetupError, Tidy3dError, Tidy3dKeyError
from tidy3d.plugins.microwave import (
CurrentIntegralAxisAligned,
Expand All @@ -23,7 +24,6 @@
TerminalPortDataArray,
WavePort,
)
from tidy3d.plugins.smatrix.ports.base_lumped import AbstractLumpedPort

from ...utils import run_emulated
from .terminal_component_modeler_def import make_coaxial_component_modeler, make_component_modeler
Expand Down
26 changes: 26 additions & 0 deletions tidy3d/microwave/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""Imports from microwave plugin."""

from __future__ import annotations

from tidy3d.components.microwave import models
from tidy3d.components.microwave.array_factor import (
RectangularAntennaArrayCalculator,
)
from tidy3d.microwave.lobe_measurer import LobeMeasurer

__all__ = [
"AxisAlignedPathIntegral",
"CurrentIntegralAxisAligned",
"CurrentIntegralTypes",
"CustomCurrentIntegral2D",
"CustomPathIntegral2D",
"CustomVoltageIntegral2D",
"ImpedanceCalculator",
"LobeMeasurer",
"RectangularAntennaArrayCalculator",
"VoltageIntegralAxisAligned",
"VoltageIntegralTypes",
"models",
"path_integrals_from_lumped_element",
"rf_material_library",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Several symbols listed in all are not imported anywhere in this file (e.g., AxisAlignedPathIntegral, ImpedanceCalculator)

]
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
from tidy3d.components.base import Tidy3dBaseModel, cached_property
from tidy3d.components.data.data_array import DataArray
from tidy3d.components.data.sim_data import SimulationData
from tidy3d.components.microwave.ports.coaxial_lumped import CoaxialLumpedPort
from tidy3d.components.microwave.ports.modal import Port
from tidy3d.components.microwave.ports.rectangular_lumped import LumpedPort
from tidy3d.components.microwave.ports.wave import WavePort
from tidy3d.components.simulation import Simulation
from tidy3d.components.types import FreqArray
from tidy3d.config import config
from tidy3d.constants import HERTZ
from tidy3d.exceptions import SetupError, Tidy3dKeyError
from tidy3d.log import log
from tidy3d.plugins.smatrix.ports.coaxial_lumped import CoaxialLumpedPort
from tidy3d.plugins.smatrix.ports.modal import Port
from tidy3d.plugins.smatrix.ports.rectangular_lumped import LumpedPort
from tidy3d.plugins.smatrix.ports.wave import WavePort
from tidy3d.web.api.container import Batch, BatchData

# fwidth of gaussian pulse in units of central frequency
FWIDTH_FRAC = 1.0 / 10
DEFAULT_DATA_DIR = "."
DEFAULT_DATA_DIR = ""

LumpedPortType = Union[LumpedPort, CoaxialLumpedPort]
TerminalPortType = Union[LumpedPortType, WavePort]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@

from tidy3d.components.base import cached_property
from tidy3d.components.data.sim_data import SimulationData
from tidy3d.components.microwave.ports.modal import ModalPortDataArray, Port
from tidy3d.components.monitor import ModeMonitor
from tidy3d.components.simulation import Simulation
from tidy3d.components.source.field import ModeSource
from tidy3d.components.source.time import GaussianPulse
from tidy3d.components.types import Ax, Complex
from tidy3d.components.viz import add_ax_if_none, equal_aspect
from tidy3d.exceptions import SetupError
from tidy3d.plugins.smatrix.ports.modal import ModalPortDataArray, Port
from tidy3d.web.api.container import BatchData

from .base import FWIDTH_FRAC, AbstractComponentModeler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
from tidy3d.components.data.sim_data import SimulationData
from tidy3d.components.geometry.utils_2d import snap_coordinate_to_grid
from tidy3d.components.microwave.data.monitor_data import AntennaMetricsData
from tidy3d.components.microwave.data.terminal import PortDataArray, TerminalPortDataArray
from tidy3d.components.microwave.ports.base_lumped import AbstractLumpedPort
from tidy3d.components.microwave.ports.coaxial_lumped import CoaxialLumpedPort
from tidy3d.components.microwave.ports.rectangular_lumped import LumpedPort
from tidy3d.components.microwave.ports.wave import WavePort
from tidy3d.components.monitor import DirectivityMonitor
from tidy3d.components.simulation import Simulation
from tidy3d.components.source.time import GaussianPulse
Expand All @@ -21,11 +26,6 @@
from tidy3d.constants import C_0, OHM
from tidy3d.exceptions import SetupError, Tidy3dError, Tidy3dKeyError, ValidationError
from tidy3d.log import log
from tidy3d.plugins.smatrix.data.terminal import PortDataArray, TerminalPortDataArray
from tidy3d.plugins.smatrix.ports.base_lumped import AbstractLumpedPort
from tidy3d.plugins.smatrix.ports.coaxial_lumped import CoaxialLumpedPort
from tidy3d.plugins.smatrix.ports.rectangular_lumped import LumpedPort
from tidy3d.plugins.smatrix.ports.wave import WavePort
from tidy3d.web.api.container import BatchData

from .base import AbstractComponentModeler, TerminalPortType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from tidy3d.components.geometry.utils_2d import increment_float
from tidy3d.components.grid.grid import Grid, YeeGrid
from tidy3d.components.lumped_element import CoaxialLumpedResistor
from tidy3d.components.microwave.path_integrals import AbstractAxesRH
from tidy3d.components.monitor import FieldMonitor
from tidy3d.components.source.current import CustomCurrentSource
from tidy3d.components.source.time import GaussianPulse
Expand All @@ -23,7 +24,6 @@
from tidy3d.constants import MICROMETER
from tidy3d.exceptions import SetupError, ValidationError
from tidy3d.plugins.microwave import CustomCurrentIntegral2D, VoltageIntegralAxisAligned
from tidy3d.plugins.microwave.path_integrals import AbstractAxesRH

from .base_lumped import AbstractLumpedPort

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 12 additions & 8 deletions tidy3d/plugins/microwave/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,28 @@

from __future__ import annotations

from . import models
from .array_factor import (
from tidy3d.components.microwave import models
from tidy3d.components.microwave.array_factor import (
RectangularAntennaArrayCalculator,
)
from .auto_path_integrals import path_integrals_from_lumped_element
from .custom_path_integrals import (
from tidy3d.components.microwave.auto_path_integrals import path_integrals_from_lumped_element
from tidy3d.components.microwave.custom_path_integrals import (
CustomCurrentIntegral2D,
CustomPathIntegral2D,
CustomVoltageIntegral2D,
)
from .impedance_calculator import CurrentIntegralTypes, ImpedanceCalculator, VoltageIntegralTypes
from .lobe_measurer import LobeMeasurer
from .path_integrals import (
from tidy3d.components.microwave.impedance_calculator import (
CurrentIntegralTypes,
ImpedanceCalculator,
VoltageIntegralTypes,
)
from tidy3d.components.microwave.path_integrals import (
AxisAlignedPathIntegral,
CurrentIntegralAxisAligned,
VoltageIntegralAxisAligned,
)
from .rf_material_library import rf_material_library
from tidy3d.components.microwave.rf_material_library import rf_material_library
from tidy3d.microwave.lobe_measurer import LobeMeasurer
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Inconsistent module placement - LobeMeasurer is imported from tidy3d.microwave while all other components are moved to tidy3d.components.microwave. This breaks the modularization pattern.


__all__ = [
"AxisAlignedPathIntegral",
Expand Down
18 changes: 11 additions & 7 deletions tidy3d/plugins/smatrix/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@

import warnings

from .component_modelers.modal import AbstractComponentModeler, ComponentModeler, ModalPortDataArray
from .component_modelers.terminal import TerminalComponentModeler
from .data.terminal import PortDataArray, TerminalPortDataArray
from .ports.coaxial_lumped import CoaxialLumpedPort
from .ports.modal import Port
from .ports.rectangular_lumped import LumpedPort
from .ports.wave import WavePort
from tidy3d.components.microwave.component_modelers.modal import (
AbstractComponentModeler,
ComponentModeler,
ModalPortDataArray,
)
from tidy3d.components.microwave.component_modelers.terminal import TerminalComponentModeler
from tidy3d.components.microwave.data.terminal import PortDataArray, TerminalPortDataArray
from tidy3d.components.microwave.ports.coaxial_lumped import CoaxialLumpedPort
from tidy3d.components.microwave.ports.modal import Port
from tidy3d.components.microwave.ports.rectangular_lumped import LumpedPort
from tidy3d.components.microwave.ports.wave import WavePort
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Consider grouping these imports by type (component modelers, data, ports) using separate import blocks with newlines for better readability


# Instantiate on plugin import till we unite with toplevel
warnings.filterwarnings(
Expand Down
Empty file.
Empty file.
4 changes: 2 additions & 2 deletions tidy3d/plugins/smatrix/smatrix.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# backwards compatibility support for ``from tidy3d.plugins.smatrix.smatrix import ``
from __future__ import annotations

from .component_modelers.modal import ComponentModeler
from .ports.modal import Port
from tidy3d.components.microwave.component_modelers.modal import ComponentModeler
from tidy3d.components.microwave.ports.modal import Port

__all__ = ["ComponentModeler", "Port"]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Add explicit version deprecation warning using warnings.warn to notify users about future path changes

Suggested change
__all__ = ["ComponentModeler", "Port"]
import warnings
warnings.warn(
"Importing from tidy3d.plugins.smatrix.smatrix is deprecated and will be removed in a future version. "
"Use 'from tidy3d.components.microwave.component_modelers.modal import ComponentModeler' instead.",
DeprecationWarning,
stacklevel=2,
)
__all__ = ["ComponentModeler", "Port"]

Loading