optimization module

Define functions related to optimization and failures plotting.

Todo

Information on the element under the cursor (hover).

_get_objectives(fault_scenario: list[Fault] | None) list[Objective]

Get the objectives stored in fault_scenario.

mark_objectives_position(ax: Axes, fault_scenarios: Sequence[list[Fault]] | None, y_axis: str = 'struct', x_axis: Literal['z_abs', 'elt_idx'] = 'z_abs', color: tuple[float, float, float] | str | tuple[float, float, float, float] | tuple[tuple[float, float, float] | str, float] | tuple[tuple[float, float, float, float], float] = 'blue', alpha: float = 0.5) None

Show where objectives are evaluated.

_line_objective(ax: Axes, x_0: float, color: tuple[float, float, float] | str | tuple[float, float, float, float] | tuple[tuple[float, float, float] | str, float] | tuple[tuple[float, float, float, float], float], alpha: float, **kwargs) Line2D

Give a vertical line to add to a plot.

This function is mainly to intercept the kwargs axvline would not understand, such as x_0 or width.

_patch_objective(x_0: float, width: float, color: tuple[float, float, float] | str | tuple[float, float, float, float] | tuple[tuple[float, float, float] | str, float] | tuple[tuple[float, float, float, float], float], alpha: float, **kwargs) Arrow

Add a marker at the exit of provided element.

plot_fit_progress(hist_f, l_label, nature='Relative')

Plot the evolution of the objective functions w/ each iteration.