Skip to content

Commit a6dd5a2

Browse files
Finally tests passing
1 parent 41c8482 commit a6dd5a2

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

tests/test_plugins/smatrix/test_terminal_component_modeler.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import xarray as xr
88

99
import tidy3d as td
10+
import tidy3d.plugins.smatrix.utils
1011
from tidy3d.components.data.data_array import FreqDataArray
1112
from tidy3d.exceptions import SetupError, Tidy3dError, Tidy3dKeyError
1213
from tidy3d.plugins.microwave import (
@@ -43,9 +44,9 @@ def run_component_modeler(monkeypatch, modeler: TerminalComponentModeler):
4344
lambda matrix: 1.0 / (2.0 * np.sqrt(np.abs(matrix) + 1e-4)),
4445
)
4546
monkeypatch.setattr(
46-
TerminalComponentModeler,
47+
td.plugins.smatrix.utils,
4748
"_check_port_impedance_sign",
48-
lambda self, Z_numpy: (),
49+
lambda Z_numpy: np.ndarray([]),
4950
)
5051

5152
s_matrix = modeler._construct_smatrix()

tidy3d/plugins/smatrix/component_modelers/terminal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,6 @@ def _construct_smatrix(self) -> TerminalPortDataArray:
440440
return _construct_smatrix(self)
441441

442442
def _internal_construct_smatrix(self, batch_data: typing.Any = None) -> TerminalPortDataArray:
443-
from tidy3d.plugins.smatrix.run import _internal_construct_smatrix
443+
from tidy3d.plugins.smatrix.run import _construct_smatrix
444444

445-
return _internal_construct_smatrix(self, batch_data=batch_data)
445+
return _construct_smatrix(self)

tidy3d/plugins/smatrix/run.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ def _port_reference_impedances(simulation) -> PortDataArray:
5050

5151

5252
def compute_power_wave_amplitudes_at_each_port(
53-
simulation, port_reference_impedances: PortDataArray, sim_data: SimulationData
53+
simulation,
54+
port_reference_impedances: PortDataArray,
55+
sim_data: SimulationData,
5456
) -> tuple[PortDataArray, PortDataArray]:
5557
"""Compute the incident and reflected power wave amplitudes at each port.
5658
The computed amplitudes have not been normalized.

0 commit comments

Comments
 (0)