Merged
Conversation
Contributor
Reviewer's GuideThis PR refactors the luminescent notebook to focus on a photonic ring resonator example using the updated luminescent API and adds a Makefile target plus an install script for streamlined backend installation. Class diagram for updated geometry and simulation setup in notebookclassDiagram
class Component {
+add_port(name, port)
+plot()
}
class LayerStack {
+layers: dict
}
class LayerLevel {
+layer: LogicalLayer
+thickness: float
+zmin: float
+material: str
+mesh_order: int
}
class LogicalLayer {
+layer: tuple
}
class Material {
+epsilon: float
}
class Source {
+name: str
+source_port_margin: float
+wavelength: float
+bandwidth: float
}
class Mode {
+ports: list
+wavelengths: list
+start: list
+stop: list
}
class View {
+field: str
+z: str
+y: int
+x: int
}
class Luminescent {
+make(path, component, wavelengths, sources, modes, zmin, zmax, materials_library, layer_stack, gpu, nres, relative_courant, relative_pml_depths, Tsim, field_decay_threshold, saveat, views)
+solve(path)
+peek(path)
+movie(path)
+load(path)
+query(sol, key)
}
Component --> LayerStack
LayerStack --> LayerLevel
LayerLevel --> LogicalLayer
Luminescent --> Material
Luminescent --> Source
Luminescent --> Mode
Luminescent --> View
Luminescent --> Component
Luminescent --> LayerStack
Luminescent --> Material
Flow diagram for new simulation workflow in the notebookflowchart TD
A["Define geometry (gdsfactory)"] --> B["Set simulation parameters (wavelengths, margins, materials)"]
B --> C["Create LayerStack and materials_library"]
C --> D["Configure sources and modes"]
D --> E["Run luminescent.make() for simulation"]
E --> F["Run luminescent.solve()"]
F --> G["Visualize with luminescent.peek() and luminescent.movie()"]
G --> H["Analyze results and plot transmission"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey there - I've reviewed your changes - here's some feedback:
- Add a shebang line (
#!/usr/bin/env bash), makeinstall_luminescent.shexecutable, and guard OS-specific commands (e.g. apt-get) so the install script won’t break on non-Debian systems. - The notebook example repeats a lot of setup (material libraries, layer stacks, margins) across cells—consider refactoring that into a reusable helper or template cell to keep it DRY.
- Make the
luminescentMakefile target idempotent by checking for existing binaries before downloading, so runningmake luminescentdoesn’t reinstall every time.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Add a shebang line (`#!/usr/bin/env bash`), make `install_luminescent.sh` executable, and guard OS-specific commands (e.g. apt-get) so the install script won’t break on non-Debian systems.
- The notebook example repeats a lot of setup (material libraries, layer stacks, margins) across cells—consider refactoring that into a reusable helper or template cell to keep it DRY.
- Make the `luminescent` Makefile target idempotent by checking for existing binaries before downloading, so running `make luminescent` doesn’t reinstall every time.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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 by Sourcery
Revamp the luminescent tutorial notebook and streamline installation workflow
New Features:
Bug Fixes:
Enhancements:
Build:
Documentation: