From ff278e6fa174305c86d8e65c390265c2afde398d Mon Sep 17 00:00:00 2001 From: Forgejo Actions Date: Sun, 19 Apr 2026 16:57:22 -0700 Subject: [PATCH] [docs] more docs cleanup --- meanas/fdfd/operators.py | 29 ++++++++++++++--------------- meanas/fdfd/waveguide_3d.py | 4 ++-- meanas/fdfd/waveguide_cyl.py | 6 +++--- meanas/fdmath/operators.py | 2 +- meanas/fdmath/vectorization.py | 3 +-- pyproject.toml | 1 + 6 files changed, 22 insertions(+), 23 deletions(-) diff --git a/meanas/fdfd/operators.py b/meanas/fdfd/operators.py index 18aaade..6425a29 100644 --- a/meanas/fdfd/operators.py +++ b/meanas/fdfd/operators.py @@ -64,11 +64,11 @@ def e_full( epsilon: Vectorized dielectric constant mu: Vectorized magnetic permeability (default 1 everywhere). pec: Vectorized mask specifying PEC cells. Any cells where `pec != 0` are interpreted - as containing a perfect electrical conductor (PEC). - The PEC is applied per-field-component (i.e. `pec.size == epsilon.size`) + as containing a perfect electrical conductor (PEC). + The PEC is applied per-field-component (i.e. `pec.size == epsilon.size`) pmc: Vectorized mask specifying PMC cells. Any cells where `pmc != 0` are interpreted - as containing a perfect magnetic conductor (PMC). - The PMC is applied per-field-component (i.e. `pmc.size == epsilon.size`) + as containing a perfect magnetic conductor (PMC). + The PMC is applied per-field-component (i.e. `pmc.size == epsilon.size`) Returns: Sparse matrix containing the wave operator. @@ -148,11 +148,11 @@ def h_full( epsilon: Vectorized dielectric constant mu: Vectorized magnetic permeability (default 1 everywhere) pec: Vectorized mask specifying PEC cells. Any cells where `pec != 0` are interpreted - as containing a perfect electrical conductor (PEC). - The PEC is applied per-field-component (i.e. `pec.size == epsilon.size`) + as containing a perfect electrical conductor (PEC). + The PEC is applied per-field-component (i.e. `pec.size == epsilon.size`) pmc: Vectorized mask specifying PMC cells. Any cells where `pmc != 0` are interpreted - as containing a perfect magnetic conductor (PMC). - The PMC is applied per-field-component (i.e. `pmc.size == epsilon.size`) + as containing a perfect magnetic conductor (PMC). + The PMC is applied per-field-component (i.e. `pmc.size == epsilon.size`) Returns: Sparse matrix containing the wave operator. @@ -217,11 +217,11 @@ def eh_full( epsilon: Vectorized dielectric constant mu: Vectorized magnetic permeability (default 1 everywhere) pec: Vectorized mask specifying PEC cells. Any cells where `pec != 0` are interpreted - as containing a perfect electrical conductor (PEC). - The PEC is applied per-field-component (i.e. `pec.size == epsilon.size`) + as containing a perfect electrical conductor (PEC). + The PEC is applied per-field-component (i.e. `pec.size == epsilon.size`) pmc: Vectorized mask specifying PMC cells. Any cells where `pmc != 0` are interpreted - as containing a perfect magnetic conductor (PMC). - The PMC is applied per-field-component (i.e. `pmc.size == epsilon.size`) + as containing a perfect magnetic conductor (PMC). + The PMC is applied per-field-component (i.e. `pmc.size == epsilon.size`) Returns: Sparse matrix containing the wave operator. @@ -267,8 +267,8 @@ def e2h( dxes: Grid parameters `[dx_e, dx_h]` as described in `meanas.fdmath.types` mu: Vectorized magnetic permeability (default 1 everywhere) pmc: Vectorized mask specifying PMC cells. Any cells where `pmc != 0` are interpreted - as containing a perfect magnetic conductor (PMC). - The PMC is applied per-field-component (i.e. `pmc.size == epsilon.size`) + as containing a perfect magnetic conductor (PMC). + The PMC is applied per-field-component (i.e. `pmc.size == epsilon.size`) Returns: Sparse matrix for converting E to H. @@ -483,4 +483,3 @@ def e_boundary_source( # (numpy.roll(mask, +1, axis=2) != mask)) return sparse.diags_array(jmask.astype(int)) @ full - diff --git a/meanas/fdfd/waveguide_3d.py b/meanas/fdfd/waveguide_3d.py index 66cc7cc..e7dfd22 100644 --- a/meanas/fdfd/waveguide_3d.py +++ b/meanas/fdfd/waveguide_3d.py @@ -52,7 +52,7 @@ def solve_mode( axis: Propagation axis (0=x, 1=y, 2=z) polarity: Propagation direction (+1 for +ve, -1 for -ve) slices: `epsilon[tuple(slices)]` is used to select the portion of the grid to use - as the waveguide cross-section. `slices[axis]` must select exactly one item. + as the waveguide cross-section. `slices[axis]` must select exactly one item. epsilon: Dielectric constant mu: Magnetic permeability (default 1 everywhere) @@ -62,7 +62,7 @@ def solve_mode( - `E`: full-grid electric field for the solved mode - `H`: full-grid magnetic field for the solved mode - `wavenumber`: propagation constant corrected for the discretized - propagation axis + propagation axis - `wavenumber_2d`: propagation constant of the reduced 2D eigenproblem Notes: diff --git a/meanas/fdfd/waveguide_cyl.py b/meanas/fdfd/waveguide_cyl.py index caedfaf..201f709 100644 --- a/meanas/fdfd/waveguide_cyl.py +++ b/meanas/fdfd/waveguide_cyl.py @@ -216,13 +216,13 @@ def solve_modes( of the bent waveguide with the specified mode number. Args: - mode_number: Number of the mode, 0-indexed + mode_numbers: Mode numbers to solve, 0-indexed. omega: Angular frequency of the simulation dxes: Grid parameters [dx_e, dx_h] as described in meanas.fdmath.types. - The first coordinate is assumed to be r, the second is y. + The first coordinate is assumed to be r, the second is y. epsilon: Dielectric constant rmin: Radius of curvature for the simulation. This should be the minimum value of - r within the simulation domain. + r within the simulation domain. Returns: e_xys: NDArray of vfdfield_t specifying fields. First dimension is mode number. diff --git a/meanas/fdmath/operators.py b/meanas/fdmath/operators.py index 19ccb80..0c64ae7 100644 --- a/meanas/fdmath/operators.py +++ b/meanas/fdmath/operators.py @@ -158,7 +158,7 @@ def cross( Args: B: List `[Bx, By, Bz]` of sparse matrices corresponding to the x, y, z - portions of the operator on the left side of the cross product. + portions of the operator on the left side of the cross product. Returns: Sparse matrix corresponding to (B x), where x is the cross product. diff --git a/meanas/fdmath/vectorization.py b/meanas/fdmath/vectorization.py index 44d8b74..77b722f 100644 --- a/meanas/fdmath/vectorization.py +++ b/meanas/fdmath/vectorization.py @@ -58,7 +58,7 @@ def vec( Args: f: A vector field, e.g. `[f_x, f_y, f_z]` where each `f_` component is a 1- to - 3-D ndarray (`f_*` should all be the same size). Doesn't fail with `f=None`. + 3-D ndarray (`f_*` should all be the same size). Doesn't fail with `f=None`. Returns: 1D ndarray containing the linearized field (or `None`) @@ -123,4 +123,3 @@ def unvec( if v is None: return None return v.reshape((nvdim, *shape), order='C') # type: ignore - diff --git a/pyproject.toml b/pyproject.toml index 4b81fa6..20a694f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,6 +63,7 @@ docs = [ "mkdocs-print-site-plugin>=2.3", "pymdown-extensions>=10.7", "htmlark>=1.0", + "ruff>=0.6", ] examples = [ "matplotlib>=3.10.8",