thin_film.optimization.operand.core#

Core types for thin-film optimization operands.

Classes

OptimizationTarget(property, wavelength_nm, ...)

Legacy spectral/angular target definition retained as public API.

SpectralOptimizationOperand(property, ...)

Concrete operand for R/T/A spectral and angular targets.

ThinFilmBaseOperand()

Base class for merit-function operands.

ThinFilmCustomOperand(operand_type[, ...])

User-defined scalar operand registered in the thin-film registry.

ThinFilmEvaluationContext(stack)

Bundles a thin-film stack for evaluation by a registered operand.

ThinFilmOperandManager()

Manages operand instances for the thin-film optimizer.

ThinFilmOperandRegistry()

Registry for thin-film operand metric functions.

class OptimizationTarget(property: str, wavelength_nm: float | list[float], target_type: Literal['equal', 'below', 'over'], value: float | list[float], weight: float, aoi_deg: float | list[float], polarization: str, tolerance: float)[source]#

Legacy spectral/angular target definition retained as public API.

aoi_deg: float | list[float]#
interpolate_target_value(current_wl: float | None = None, current_aoi: float | None = None) float[source]#
polarization: str#
property: str#
target_type: Literal['equal', 'below', 'over']#
tolerance: float#
value: float | list[float]#
wavelength_nm: float | list[float]#
weight: float#
class SpectralOptimizationOperand(property: str, wavelength_nm: float | list[float], target_type: Literal['equal', 'below', 'over'], value: float | list[float], weight: float, aoi_deg: float | list[float], polarization: str, tolerance: float)[source]#

Concrete operand for R/T/A spectral and angular targets.

aoi_deg: float | list[float]#
current_values(context: ThinFilmEvaluationContext) list[float][source]#
delta(context: ThinFilmEvaluationContext) float[source]#

Compute the scalar residual for this operand.

property display_name: str#
fun(context: ThinFilmEvaluationContext) float#
interpolate_target_value(current_wl: float | None = None, current_aoi: float | None = None) float#
performance_data(context: ThinFilmEvaluationContext) dict[str, Any][source]#

Return performance metrics dict for reporting.

plot(ax, plot_type: str, x_values: numpy.ndarray, **kwargs) None[source]#
polarization: str#
property: str#
residuals(context: ThinFilmEvaluationContext) list[float][source]#
target_type: Literal['equal', 'below', 'over']#
tolerance: float#
value: float | list[float]#
wavelength_nm: float | list[float]#
weight: float#
class ThinFilmBaseOperand[source]#

Base class for merit-function operands.

abstractmethod delta(context: ThinFilmEvaluationContext) float[source]#

Compute the scalar residual for this operand.

fun(context: ThinFilmEvaluationContext) float[source]#
abstractmethod performance_data(context: ThinFilmEvaluationContext) dict[str, Any][source]#

Return performance metrics dict for reporting.

plot(ax, plot_type: str, x_values: numpy.ndarray, **kwargs) None[source]#
weight: float#
class ThinFilmCustomOperand(operand_type: str, weight: float = 1.0, target: float | None = None, min_val: float | None = None, max_val: float | None = None, input_data: dict[str, Any] | None = None, label: str | None = None)[source]#

User-defined scalar operand registered in the thin-film registry.

delta(context: ThinFilmEvaluationContext) float[source]#

Compute the scalar residual for this operand.

property display_name: str#
fun(context: ThinFilmEvaluationContext) float#
input_data: dict[str, Any] | None = None#
label: str | None = None#
max_val: float | None = None#
min_val: float | None = None#
operand_type: str#
performance_data(context: ThinFilmEvaluationContext) dict[str, Any][source]#

Return performance metrics dict for reporting.

plot(ax, plot_type: str, x_values: numpy.ndarray, **kwargs) None[source]#

Draw horizontal reference lines for min_val / max_val / target.

Since a custom operand is a scalar metric without an intrinsic wavelength or angle axis, its constraint bounds are shown as horizontal lines so they can be read against whichever quantity is on the y-axis.

target: float | None = None#
value(context: ThinFilmEvaluationContext) float[source]#
weight: float = 1.0#
class ThinFilmEvaluationContext(stack: ThinFilmStack)[source]#

Bundles a thin-film stack for evaluation by a registered operand.

stack: ThinFilmStack#
class ThinFilmOperandManager[source]#

Manages operand instances for the thin-film optimizer.

add(operand: ThinFilmBaseOperand) None[source]#
clear() None[source]#
class ThinFilmOperandRegistry[source]#

Registry for thin-film operand metric functions.

get(name: str) Callable[..., float] | None[source]#
register(name: str, func: Callable[..., float], overwrite: bool = False) None[source]#