-
Notifications
You must be signed in to change notification settings - Fork 49
update luminescent #661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update luminescent #661
Conversation
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Summary by Sourcery
Revamp the luminescent tutorial notebook and streamline installation workflow
New Features:
Bug Fixes:
Enhancements:
Build:
Documentation: