Skip to content

Commit ebb1315

Browse files
Enable backwards compatibility
1 parent 1f1effa commit ebb1315

File tree

16 files changed

+25
-21
lines changed

16 files changed

+25
-21
lines changed

tests/test_plugins/smatrix/test_terminal_component_modeler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import tidy3d as td
1010
from tidy3d.components.data.data_array import FreqDataArray
11+
from tidy3d.components.microwave.ports import AbstractLumpedPort
1112
from tidy3d.exceptions import SetupError, Tidy3dError, Tidy3dKeyError
1213
from tidy3d.plugins.microwave import CustomCurrentIntegral2D, VoltageIntegralAxisAligned
1314
from tidy3d.plugins.smatrix import (
@@ -19,7 +20,6 @@
1920
TerminalPortDataArray,
2021
WavePort,
2122
)
22-
from tidy3d.plugins.smatrix.ports.base_lumped import AbstractLumpedPort
2323

2424
from ...utils import run_emulated
2525
from .terminal_component_modeler_def import make_coaxial_component_modeler, make_component_modeler

tidy3d/plugins/smatrix/component_modelers/base.py renamed to tidy3d/components/microwave/component_modelers/base.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@
1212
from tidy3d.components.base import Tidy3dBaseModel, cached_property
1313
from tidy3d.components.data.data_array import DataArray
1414
from tidy3d.components.data.sim_data import SimulationData
15+
from tidy3d.components.microwave.ports.coaxial_lumped import CoaxialLumpedPort
16+
from tidy3d.components.microwave.ports.modal import Port
17+
from tidy3d.components.microwave.ports.rectangular_lumped import LumpedPort
18+
from tidy3d.components.microwave.ports.wave import WavePort
1519
from tidy3d.components.simulation import Simulation
1620
from tidy3d.components.types import FreqArray
1721
from tidy3d.config import config
1822
from tidy3d.constants import HERTZ
1923
from tidy3d.exceptions import SetupError, Tidy3dKeyError
2024
from tidy3d.log import log
21-
from tidy3d.plugins.smatrix.ports.coaxial_lumped import CoaxialLumpedPort
22-
from tidy3d.plugins.smatrix.ports.modal import Port
23-
from tidy3d.plugins.smatrix.ports.rectangular_lumped import LumpedPort
24-
from tidy3d.plugins.smatrix.ports.wave import WavePort
2525
from tidy3d.web.api.container import Batch, BatchData
2626

2727
# fwidth of gaussian pulse in units of central frequency
2828
FWIDTH_FRAC = 1.0 / 10
29-
DEFAULT_DATA_DIR = "."
29+
DEFAULT_DATA_DIR = ""
3030

3131
LumpedPortType = Union[LumpedPort, CoaxialLumpedPort]
3232
TerminalPortType = Union[LumpedPortType, WavePort]

tidy3d/plugins/smatrix/component_modelers/modal.py renamed to tidy3d/components/microwave/component_modelers/modal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111

1212
from tidy3d.components.base import cached_property
1313
from tidy3d.components.data.sim_data import SimulationData
14+
from tidy3d.components.microwave.ports.modal import ModalPortDataArray, Port
1415
from tidy3d.components.monitor import ModeMonitor
1516
from tidy3d.components.simulation import Simulation
1617
from tidy3d.components.source.field import ModeSource
1718
from tidy3d.components.source.time import GaussianPulse
1819
from tidy3d.components.types import Ax, Complex
1920
from tidy3d.components.viz import add_ax_if_none, equal_aspect
2021
from tidy3d.exceptions import SetupError
21-
from tidy3d.plugins.smatrix.ports.modal import ModalPortDataArray, Port
2222
from tidy3d.web.api.container import BatchData
2323

2424
from .base import FWIDTH_FRAC, AbstractComponentModeler

tidy3d/plugins/smatrix/component_modelers/terminal.py renamed to tidy3d/components/microwave/component_modelers/terminal.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
from tidy3d.components.data.sim_data import SimulationData
1414
from tidy3d.components.geometry.utils_2d import snap_coordinate_to_grid
1515
from tidy3d.components.microwave.data.monitor_data import AntennaMetricsData
16+
from tidy3d.components.microwave.data.terminal import PortDataArray, TerminalPortDataArray
17+
from tidy3d.components.microwave.ports.base_lumped import AbstractLumpedPort
18+
from tidy3d.components.microwave.ports.coaxial_lumped import CoaxialLumpedPort
19+
from tidy3d.components.microwave.ports.rectangular_lumped import LumpedPort
20+
from tidy3d.components.microwave.ports.wave import WavePort
1621
from tidy3d.components.monitor import DirectivityMonitor
1722
from tidy3d.components.simulation import Simulation
1823
from tidy3d.components.source.time import GaussianPulse
@@ -21,11 +26,6 @@
2126
from tidy3d.constants import C_0, OHM
2227
from tidy3d.exceptions import Tidy3dError, Tidy3dKeyError, ValidationError
2328
from tidy3d.log import log
24-
from tidy3d.plugins.smatrix.data.terminal import PortDataArray, TerminalPortDataArray
25-
from tidy3d.plugins.smatrix.ports.base_lumped import AbstractLumpedPort
26-
from tidy3d.plugins.smatrix.ports.coaxial_lumped import CoaxialLumpedPort
27-
from tidy3d.plugins.smatrix.ports.rectangular_lumped import LumpedPort
28-
from tidy3d.plugins.smatrix.ports.wave import WavePort
2929
from tidy3d.web.api.container import BatchData
3030

3131
from .base import AbstractComponentModeler, TerminalPortType

tidy3d/plugins/smatrix/__init__.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44

55
import warnings
66

7-
from .component_modelers.modal import AbstractComponentModeler, ComponentModeler, ModalPortDataArray
8-
from .component_modelers.terminal import TerminalComponentModeler
9-
from .data.terminal import PortDataArray, TerminalPortDataArray
10-
from .ports.coaxial_lumped import CoaxialLumpedPort
11-
from .ports.modal import Port
12-
from .ports.rectangular_lumped import LumpedPort
13-
from .ports.wave import WavePort
7+
from tidy3d.components.microwave.component_modelers.modal import (
8+
AbstractComponentModeler,
9+
ComponentModeler,
10+
ModalPortDataArray,
11+
)
12+
from tidy3d.components.microwave.component_modelers.terminal import TerminalComponentModeler
13+
from tidy3d.components.microwave.data.terminal import PortDataArray, TerminalPortDataArray
14+
from tidy3d.components.microwave.ports.coaxial_lumped import CoaxialLumpedPort
15+
from tidy3d.components.microwave.ports.modal import Port
16+
from tidy3d.components.microwave.ports.rectangular_lumped import LumpedPort
17+
from tidy3d.components.microwave.ports.wave import WavePort
1418

1519
# Instantiate on plugin import till we unite with toplevel
1620
warnings.filterwarnings(

tidy3d/plugins/smatrix/ports/__init__.py

Whitespace-only changes.

tidy3d/plugins/smatrix/smatrix.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# backwards compatibility support for ``from tidy3d.plugins.smatrix.smatrix import ``
22
from __future__ import annotations
33

4-
from .component_modelers.modal import ComponentModeler
5-
from .ports.modal import Port
4+
from tidy3d.components.microwave.component_modelers.modal import ComponentModeler
5+
from tidy3d.components.microwave.ports.modal import Port
66

77
__all__ = ["ComponentModeler", "Port"]

0 commit comments

Comments
 (0)