FomPanel#
- class lumopt2.utils.panels.FomPanel(title: str | None = 'Optimization Progress', show_best: bool = True, log_y: bool = False, color: str = 'C0', marker: str = 'o', linewidth: float = 2.0, markersize: float = 4.0, label: str = 'FOM')#
Live plot of the figure of merit vs. iteration.
A single
matplotlib.lines.Line2Dand an annotationmatplotlib.text.Textare created insetup()and mutated in place byupdate(), so the panel stays inexpensive to redraw even for long runs.- Attributes:
- title
str,optional Panel title (default:
'Optimization Progress').- show_bestbool,
optional If
True, annotate the best (maximum) FOM value seen so far in the upper-left corner of the panel (default:True).- log_ybool,
optional If
True, render the FOM trace on a logarithmic y-axis. Useful when the FOM spans many decades. Note that non-positive values are clipped by matplotlib in log mode (default:False).- color
str,optional Matplotlib color spec for the trace (default:
'C0').- marker
str,optional Matplotlib marker for the trace (default:
'o').- linewidth
float,optional Line width for the trace (default:
2.0).- markersize
float,optional Marker size for the trace (default:
4.0).- label
str,optional Legend label for the trace (default:
'FOM').
- title
Methods
FomPanel.on_optimization_end(ax, fig, ...)Optional hook called once when the optimization completes.
FomPanel.setup(ax, fig, project)Create the persistent line + best-text artists on
ax.FomPanel.update(ax, fig, project, state)Push the latest FOM history into the persistent artists.
Attributes