optimization module
Define functions related to optimization and failures plotting.
Todo
Information on the element under the cursor (hover).
- 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:
ax (
Axes)y_axis (
str, default:'struct')x_axis (
Literal['z_abs','elt_idx'], default:'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], default:'blue')alpha (
float, default:0.5)
- Return type:
- _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.