thin_film.tolerancing.monte_carlo

Monte Carlo analysis for thin film stacks.

Applies all perturbations simultaneously per iteration and collects statistics, following the pattern of optiland.tolerancing.monte_carlo.

Classes

ThinFilmMonteCarlo(tolerancing)

Monte Carlo simulation for a thin-film tolerancing setup.

class ThinFilmMonteCarlo(tolerancing: ThinFilmTolerancing)[source]

Monte Carlo simulation for a thin-film tolerancing setup.

Parameters:

tolerancing – A configured ThinFilmTolerancing instance.

get_results() pandas.DataFrame

Return the results DataFrame.

run(num_iterations: int) None[source]

Run the Monte Carlo simulation.

All perturbations are applied simultaneously in each iteration.

Parameters:

num_iterations – Number of Monte Carlo trials.

view(figsize: tuple[float, float] = (2.5, 3.3), sharex: Literal['none', 'all', 'row', 'col'] | bool = 'col', sharey: Literal['none', 'all', 'row', 'col'] | bool = 'row') tuple[Figure, list[Axes]]

Visualize sensitivity results as a grid of subplots.

Returns:

Tuple of (figure, flat list of axes).

view_cdf() tuple[Figure, NDArray[np.object_]][source]

Display CDF plots of operand distributions.

view_heatmap(figsize: tuple[float, float] = (8, 6), vmin: float | None = None, vmax: float | None = None) tuple[Figure, Axes][source]

Display a correlation heatmap of the results.

view_histogram(kde: bool = True) tuple[Figure, NDArray[np.object_]][source]

Display histograms of operand distributions.