Skip to content

Commit 718da4a

Browse files
authored
Merge pull request #50 from flaport/bump-sax
bump sax
2 parents 3e38fc2 + e601584 commit 718da4a

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ dependencies = [
2323
"orjson>=3.0.0",
2424
"pydantic>=2.10.0",
2525
"pyyaml>=6.0.2",
26-
"sax>=0.15.0",
26+
"sax>=0.15.4",
2727
"shapely>=2.1.0",
2828
"tidy3d>=2.8.0,<2.9.0",
2929
"tqdm>=4.67.0",

src/meow/eme/propagate.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,10 @@ def propagate_modes(
195195
ex_r: ComplexArray1D,
196196
y: float,
197197
z: FloatArray1D,
198-
sax_backend: sax.BackendOrDefault = "default",
198+
sax_backend: sax.BackendLike = "default",
199199
) -> tuple[ComplexArray2D, FloatArray1D]:
200200
"""Propagate the modes through the cells."""
201-
sax_backend = sax.validate_circuit_backend(sax_backend)
201+
actual_sax_backend = sax.into[sax.Backend](sax_backend)
202202
propagations = compute_propagation_s_matrices(modes, cells)
203203
interfaces = compute_interface_s_matrices(
204204
modes,
@@ -210,9 +210,9 @@ def propagate_modes(
210210
enforce_reciprocity=False,
211211
)
212212

213-
pairs = pi_pairs(propagations, interfaces, sax_backend)
214-
l2rs = l2r_matrices(pairs, identity, sax_backend)
215-
r2ls = r2l_matrices(pairs, sax_backend)
213+
pairs = pi_pairs(propagations, interfaces, actual_sax_backend)
214+
l2rs = l2r_matrices(pairs, identity, actual_sax_backend)
215+
r2ls = r2l_matrices(pairs, actual_sax_backend)
216216

217217
forwards, backwards = propagate(l2rs, r2ls, ex_l, ex_r)
218218
return plot_fields(modes, cells, forwards, backwards, y, z)

src/meow/eme/sax.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ def compute_s_matrix_sax(
6767
modes: list[list[Mode]],
6868
cells: list[Cell] | None = None,
6969
cell_lengths: list[float] | None = None,
70-
sax_backend: sax.BackendOrDefault = "default",
70+
sax_backend: sax.BackendLike = "default",
7171
*,
7272
conjugate: bool = DEFAULT_CONJUGATE,
7373
enforce_reciprocity: bool = DEFAULT_ENFORCE_RECIPROCITY,
7474
enforce_lossy_unitarity: bool = DEFAULT_ENFORCE_LOSSY_UNITARITY,
7575
**kwargs: Any,
7676
) -> sax.SDenseMM:
7777
"""Calculate the S-matrix for given sets of modes."""
78-
sax_backend = sax.validate_circuit_backend(sax_backend)
78+
actual_sax_backend = sax.into[sax.Backend](sax_backend)
7979
_compute_propagation_s_matrices = kwargs.pop(
8080
"compute_propagation_s_matrices", compute_propagation_s_matrices
8181
)
@@ -95,7 +95,7 @@ def compute_s_matrix_sax(
9595

9696
# TODO: fix SAX Multimode to reduce this ad-hoc SAX-hacking.
9797
net = _get_netlist(propagations, interfaces)
98-
_, analyze_circuit, evaluate_circuit = circuit_backends[sax_backend]
98+
_, analyze_circuit, evaluate_circuit = circuit_backends[actual_sax_backend]
9999
# TODO: use analyze_instances instead of manually converting to scoo ?
100100
net["instances"] = {k: sax.scoo(v) for k, v in net["instances"].items()}
101101
analyzed = analyze_circuit(net["instances"], net["connections"], net["ports"])

0 commit comments

Comments
 (0)