suboptimumg.sweep.pack_optimizer_results#

class suboptimumg.sweep.pack_optimizer_results.PackOptimizerResults(data, config)[source]#

Bases: object

Results for a pack optimization run, with visualization

Parameters:
plot_3D(x_var, y_var, show_infeasible=True, title=None, subtitle=None, theme=None, font_config=FontConfig(large=24, medium=16, small=12), layout_config=LayoutConfig(width=1000, height=700, grid_width_per_col=400, grid_height_per_row=350, grid_horizontal_spacing=0.08, grid_vertical_spacing=0.12, margin={'l': 70, 'r': 50, 't': 90, 'b': 70}, plot_bgcolor='white', scene_bgcolor='rgba(240, 240, 240, 0.8)', title_x=0.5, title_xanchor='center', title_yanchor='top'))[source]#

Create a 3D Plotly figure of the optimization results, including all intermediate evaluations. Plots two parameters (e.g., coast_trigger and gear_ratio) vs total points.

Parameters:
  • x_var (str) – Name of the parameter to plot on the x-axis (e.g., “coast_trigger”)

  • y_var (str) – Name of the parameter to plot on the y-axis (e.g., “gear_ratio”)

  • show_infeasible (bool) – Whether to include energy-infeasible points in the plot.

  • subtitle (str, optional) – Optional subtitle displayed below the title.

  • theme (str, optional) – Color theme name, see plotting.color_themes.

  • font_config (FontConfig, optional) – FontConfig object for font settings.

  • layout_config (LayoutConfig, optional) – LayoutConfig object for layout settings.

  • title (str | None)

Returns:

Interactive Plotly 3D scatter figure.

Return type:

go.Figure

save(path)[source]#

Serialize results to a JSON file using Pydantic’s native serialization.

Parameters:

path (str) – Destination file path (e.g., “results/run.json”).

Return type:

None

summarize()[source]#

Print a concise summary of the optimization results.

Return type:

None

suboptimumg.sweep.pack_optimizer_results.load(cls, path)[source]#

Deserialize results from a JSON file.

Parameters:

path (str) – Path to a JSON file previously written by save().

Return type:

PackOptimizerResults