{"id":23806,"library":"gplugins","title":"gplugins","description":"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.","status":"active","version":"2.0.1","language":"python","source_language":"en","source_url":"https://github.com/gdsfactory/gplugins","tags":["photonic-design","gdsfactory","simulation"],"install":[{"cmd":"pip install gplugins","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Primary dependency; gplugins extends gdsfactory.","package":"gdsfactory","optional":false},{"reason":"For FDTD simulations via the meep plugin.","package":"meep","optional":true},{"reason":"For FDTD simulations via the tidy3d plugin.","package":"tidy3d","optional":true},{"reason":"For TCAD device simulation.","package":"devsim","optional":true},{"reason":"For material dispersion fitting.","package":"nk","optional":true}],"imports":[{"note":"Namespace conflict: using 'meep' shadows the actual meep package. Use 'gm' to avoid confusion.","wrong":"import gplugins.meep as meep","symbol":"meep","correct":"import gplugins.meep as gm"},{"note":"Namespace conflict: using 'tidy3d' shadows the actual tidy3d package. Use 'gt' to avoid confusion.","wrong":"import gplugins.tidy3d as tidy3d","symbol":"tidy3d","correct":"import gplugins.tidy3d as gt"},{"note":"Star imports are discouraged; submodules like meep or tidy3d are not automatically imported.","wrong":"from gplugins import *","symbol":"gplugins","correct":"import gplugins"}],"quickstart":{"code":"import gdsfactory as gf\nimport gplugins.meep as gm\n\nc = gf.c.straight_heater_metal(length=5, width=0.5)\n\n# Simulate using meep\nsim_settings = {\n    \"resolution\": 20,\n    \"wavelength\": 1.55,\n    \"duration\": 1e-12,\n}\ngm.write_sparameters_meep(c, filepath=\"sparams.h5\", **sim_settings)\n","lang":"python","description":"Basic meep simulation using gplugins. Requires gdsfactory and meep installed."},"warnings":[{"fix":"Update imports: `import gplugins.meep as gm` instead of `from gplugins import meep`. Use submodule-specific aliases.","message":"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.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Call `c.write_gds('temp.gds')` before simulation or provide a component that is already linked to a file.","message":"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.","severity":"gotcha","affected_versions":"all"},{"fix":"Set environment variable `TIDY3D_API_KEY` or configure tidy3d via `tidy3d.config.api_key = '...'` before using the plugin.","message":"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.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Upgrade to gplugins >=2.0: `pip install --upgrade gplugins`","cause":"Installed an older version of gplugins (<2.0) where submodules were not organized under 'gplugins.meep'.","error":"ModuleNotFoundError: No module named 'gplugins.meep'"},{"fix":"Use `import gplugins.meep as gm` and call `gm.write_sparameters_meep(...)`","cause":"Used `import gplugins.meep` without an alias, then tried to call meep functions directly.","error":"NameError: name 'meep' is not defined"},{"fix":"Write the component to a GDS file first: `c.write_gds('temp.gds')` then pass the component.","cause":"The component does not have an associated GDS file, and simulation routines require one.","error":"FileNotFoundError: [Errno 2] No such file or directory: 'temp.gds'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}