From 47415a0beb01c3dcadae58a64c65eee2322ec890 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Tue, 7 Jan 2025 00:04:53 -0800 Subject: [PATCH] Return list-of-vectors from waveguide mode solve --- meanas/fdfd/waveguide_2d.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/meanas/fdfd/waveguide_2d.py b/meanas/fdfd/waveguide_2d.py index 05215c4..8ea4846 100644 --- a/meanas/fdfd/waveguide_2d.py +++ b/meanas/fdfd/waveguide_2d.py @@ -179,6 +179,7 @@ to account for numerical dispersion if the result is introduced into a space wit # TODO update module docs from typing import Any +from collections.abc import Sequence import numpy from numpy.typing import NDArray, ArrayLike from numpy.linalg import norm @@ -871,7 +872,7 @@ def solve_modes( wavenumbers = numpy.sqrt(eigvals) wavenumbers *= numpy.sign(numpy.real(wavenumbers)) - return e_xys, wavenumbers + return e_xys.T, wavenumbers def solve_mode( @@ -892,4 +893,4 @@ def solve_mode( """ kwargs['mode_numbers'] = [mode_number] e_xys, wavenumbers = solve_modes(*args, **kwargs) - return e_xys[:, 0], wavenumbers[0] + return e_xys[0], wavenumbers[0]