[examples] fix eme bend example
This commit is contained in:
parent
37ed9d10bc
commit
e851e25568
2 changed files with 6 additions and 1 deletions
|
|
@ -264,7 +264,7 @@ def main() -> None:
|
||||||
skrf = require_optional('skrf', package_name='scikit-rf')
|
skrf = require_optional('skrf', package_name='scikit-rf')
|
||||||
|
|
||||||
grid, epsilon, dxes_2d, omega = build_geometry()
|
grid, epsilon, dxes_2d, omega = build_geometry()
|
||||||
epsilon_slice = epsilon[:, :, :, 2]
|
epsilon_slice = epsilon[:, :, :, 1]
|
||||||
rmin = RADIUS + grid.xyz[0].min()
|
rmin = RADIUS + grid.xyz[0].min()
|
||||||
|
|
||||||
straight_modes, straight_wavenumbers = solve_straight_modes(epsilon_slice, omega=omega, dxes_2d=dxes_2d)
|
straight_modes, straight_wavenumbers = solve_straight_modes(epsilon_slice, omega=omega, dxes_2d=dxes_2d)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
@ -46,6 +47,10 @@ def test_eme_bend_example_smoke_runs(tmp_path: Path) -> None:
|
||||||
assert 'straight effective indices:' in result.stdout
|
assert 'straight effective indices:' in result.stdout
|
||||||
assert 'cascaded bend through power' in result.stdout
|
assert 'cascaded bend through power' in result.stdout
|
||||||
|
|
||||||
|
straight_index_match = re.search(r'straight effective indices:\s*([0-9.]+)', result.stdout)
|
||||||
|
assert straight_index_match is not None, result.stdout
|
||||||
|
assert float(straight_index_match.group(1)) > 1.6
|
||||||
|
|
||||||
|
|
||||||
def test_eme_taper_cmt_example_smoke_runs(tmp_path: Path) -> None:
|
def test_eme_taper_cmt_example_smoke_runs(tmp_path: Path) -> None:
|
||||||
result = _run_example('eme_taper_cmt.py', tmp_path)
|
result = _run_example('eme_taper_cmt.py', tmp_path)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue