gemseo.post.base_post module#

Base class for optimization history post-processing.

class BasePost(opt_problem)[source]#

Bases: Generic[T]

Base class for optimization post-processing.

Initialize self. See help(type(self)) for accurate signature.

Parameters:

opt_problem (OptimizationProblem) -- The optimization problem to be post-processed.

execute(settings_model=None, **settings)[source]#

Post-process the optimization problem.

Parameters:
  • settings_model (BasePostSettings | None) -- The post-processor settings as a Pydantic model. If None, use **settings.

  • **settings (Any) -- The post-processor settings. This argument is ignored when settings_model is not None.

Returns:

The figures, to be customized; in the case of a matplotlib Figure, it must not be closed.

Raises:

ValueError -- If the opt_problem.database is empty.

Return type:

dict[str, Figure | DatasetPlot]

Settings: ClassVar[type[T]]#

The Pydantic model for the settings.

database: Database#

The database generated by the optimization problem.

property figures: dict[str, Figure | DatasetPlot]#

The figures indexed by a name, or the nameless figure counter.

materials_for_plotting: dict[Any, Any]#

The materials to eventually rebuild the plot in another framework.

optimization_problem: OptimizationProblem#

The optimization problem.

property output_file_paths: list[Path]#

The paths to the output files.