feat: callable API, energy_decay runner, viz refactors#17
Merged
Conversation
- Add __call__(**kwargs) to Geometry, ModeSource, Domain, FDTD for fluent updates: sim.source(port="o1", wavelength=1.55) - Add energy_decay stopping mode to StoppingConfig and cloud runner using mp.stop_when_energy_decayed() with _make_time_cap() callable - Extract shared helpers: stack/_layer_utils.py (layer classification), viz/_mesh_helpers.py (Delaunay triangulation, batch prism geometry) - Remove Three.js backend (render3d_threejs.py + viewer.html) - Add view buttons (Iso/Top/Front/Right) to Open3D+Plotly 3D viewer - Trim gsim.common public exports to essentials - Update notebooks to callable style, add meep_ring_coupler notebook - Update meep-overview.md with all architectural changes
… 95% threshold Rename mode string "decay" → "field_decay" for clarity, switch default from energy_decay to field_decay to match MEEP tutorial conventions, and set decay_by default to 0.05 (95% decay).
vvahidd
marked this pull request as draft
February 17, 2026 11:53
vvahidd
marked this pull request as ready for review
February 17, 2026 11:54
stop_after(time) was ambiguous — unclear it meant "after sources die." Renamed to stop_after_sources(time) for clarity. Added wall_time_max field + stop_after_walltime(seconds) method as an orthogonal wall-clock safety net. The runner appends _make_wall_time_cap() to until_after_sources in all 4 stopping mode branches when enabled. Logs a warning when the wall-clock limit likely triggered.
MEEP eigenmode coefficients are wrong when source and monitor overlap
at the same position (standard FDTD soft-source behavior). Match the
gplugins approach: offset source inward by 0.1um, source-port monitor
by 0.3um (0.2um past source), non-source monitors by 0.1um.
Also includes: refactor gcloud.py to use RunResult dataclass with
structured sim-data-{job_name}/ directories, update palace module
run() signatures, add meep_straight and meep_sbend notebooks, remove
stale meep-overview.md.
Use a matrix strategy to run each notebook on its own runner simultaneously instead of sequentially. A list-notebooks job discovers all .ipynb files, then run-notebook fans out in parallel with fail-fast: false. The build job collects all artifacts via merge-multiple before building docs.
vvahidd
added a commit
that referenced
this pull request
Feb 18, 2026
The write_config() cell was removed from palace notebooks in PR #17 but run() still required config.json to exist. Now run() automatically generates config.json if it hasn't been written yet.
vvahidd
added a commit
that referenced
this pull request
Feb 18, 2026
* fix: remove bver dependency from dev recipe The bver install script fails in CI because the GitHub release is unavailable, breaking all notebook doc builds. bver is only needed for version bumping, not dev environment setup. * fix: auto-call write_config() in DrivenSim.run() The write_config() cell was removed from palace notebooks in PR #17 but run() still required config.json to exist. Now run() automatically generates config.json if it hasn't been written yet.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Geometry,ModeSource,Domain,FDTDnow have__call__(**kwargs)enabling fluent configuration:sim.source(port="o1", wavelength=1.55)instead of field-by-field assignmentenergy_decaystopping mode — Added toStoppingConfigand cloud runner script usingmp.stop_when_energy_decayed()with a_make_time_cap()callable for OR-logic time capsviz/_mesh_helpers.pyand layer classification intostack/_layer_utils.py(used by both PyVista/Open3D renderers and extractor/visualization)render3d_threejs.py+viewer.html; Open3D+Plotly gets view buttons (Iso/Top/Front/Right) and orthographic projectiongsim.commonexports — Public API reduced to essentials (Geometry,GeometryModel,LayerStack,Prism,ValidationResult)meep_ybranchconverted to callable style; newmeep_ring_couplernotebook addedmeep-overview.mdupdated — Documents all architectural changesTest plan
uv run pytest tests/meep/test_simulation.py tests/meep/test_meep_models.py -v— 141 passuv run pytest tests/ -v— 198 pass (1 pre-existing version assertion failure)