optimization module

Define functions related to optimization and failures plotting.

Todo

Information on the element under the cursor (hover).

_get_objectives(fault_scenario)[source]

Get the objectives stored in fault_scenario.

Parameters:

fault_scenario (list[Fault] | None)

Return type:

list[Objective]

warn_once()[source]

Raise this warning only once.

https://stackoverflow.com/questions/31953272/logging-print-message-only-once

mark_objectives_position(ax, fault_scenarios, y_axis='struct', x_axis='z_abs', color='blue', alpha=0.5)[source]

Show where objectives are evaluated.

Todo

Fix bug when several fault scenarios are plotted.

Parameters:
Return type:

None

_line_objective(ax, x_0, color, alpha, **kwargs)[source]

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.

Parameters:
Return type:

Line2D

_patch_objective(x_0, width, color, alpha, **kwargs)[source]

Add a marker at the exit of provided element.

Parameters:
Return type:

Arrow

plot_fit_progress(hist_f, l_label, nature='Relative')[source]

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