Panel#
- class lumopt2.utils.panels.Panel(title: str | None = None)#
Abstract base class for a single subplot in a
GraphicalVisualizer.Subclasses implement
setupto create their persistent matplotlib artists andupdateto refresh those artists on every iteration. The defaulton_optimization_endis a no-op; override it for any end-of-run flourishes (e.g. drawing a “converged” marker).- Attributes:
- title
str,optional Title for the panel’s subplot. Subclasses pick a sensible default when
None(default:None).- requires_forward_resultsbool
Class-level flag. When
True,GraphicalVisualizerensures the project’s FDTD session has the latest forward simulation file loaded before callingupdate(). Override in subclasses that read monitor data from the live FDTD session (e.g.MonitorPanel). Defaults toFalseso panels whose data comes purely fromPanelState(FOM trace, gradient norm, geometry) avoid the disk reload cost.
- title
Methods
Panel.on_optimization_end(ax, fig, project, ...)Optional hook called once when the optimization completes.
Panel.setup(ax, fig, project)Initialise the panel on its assigned axes.
Panel.update(ax, fig, project, state)Refresh the panel from a
PanelStatesnapshot.Attributes