gplugins
raw JSON → 2.0.1 verified Fri May 01 auth: no python
Plugins for gdsfactory, a Python library for photonic chip design. Provides simulation (meep, tidy3d), netlist extraction, and DFM checks. Current stable version: 2.0.1, release cadence is irregular. Requires Python >=3.11.
pip install gplugins Common errors
error ModuleNotFoundError: No module named 'gplugins.meep' ↓
cause Installed an older version of gplugins (<2.0) where submodules were not organized under 'gplugins.meep'.
fix
Upgrade to gplugins >=2.0:
pip install --upgrade gplugins error NameError: name 'meep' is not defined ↓
cause Used `import gplugins.meep` without an alias, then tried to call meep functions directly.
fix
Use
import gplugins.meep as gm and call gm.write_sparameters_meep(...) error FileNotFoundError: [Errno 2] No such file or directory: 'temp.gds' ↓
cause The component does not have an associated GDS file, and simulation routines require one.
fix
Write the component to a GDS file first:
c.write_gds('temp.gds') then pass the component. Warnings
breaking Version 2.0.0 renamed all submodules (e.g., 'meep' became 'gplugins.meep') and removed top-level imports. Old code using `from gplugins import *` or `import gplugins.meep as meep` will break. ↓
fix Update imports: `import gplugins.meep as gm` instead of `from gplugins import meep`. Use submodule-specific aliases.
gotcha The `write_sparameters_meep` function requires the component to be a full path to a GDS file or a Component with a GDS file written. In-memory components not written to file cause silent errors. ↓
fix Call `c.write_gds('temp.gds')` before simulation or provide a component that is already linked to a file.
gotcha Tidy3d plugin requires an API key set via `TIDY3D_API_KEY` environment variable or tidy3d config. Simulation will fail with a vague authentication error if missing. ↓
fix Set environment variable `TIDY3D_API_KEY` or configure tidy3d via `tidy3d.config.api_key = '...'` before using the plugin.
Imports
- meep wrong
import gplugins.meep as meepcorrectimport gplugins.meep as gm - tidy3d wrong
import gplugins.tidy3d as tidy3dcorrectimport gplugins.tidy3d as gt - gplugins wrong
from gplugins import *correctimport gplugins
Quickstart
import gdsfactory as gf
import gplugins.meep as gm
c = gf.c.straight_heater_metal(length=5, width=0.5)
# Simulate using meep
sim_settings = {
"resolution": 20,
"wavelength": 1.55,
"duration": 1e-12,
}
gm.write_sparameters_meep(c, filepath="sparams.h5", **sim_settings)