gemseo / post

variable_influence module

Plot the partial sensitivity of the functions.

Classes:

VariableInfluence(opt_problem)

First order variable influence analysis.

class gemseo.post.variable_influence.VariableInfluence(opt_problem)[source]

Bases: gemseo.post.opt_post_processor.OptPostProcessor

First order variable influence analysis.

This post-processing computes df/dxi * (xi* - xi0) where xi0 is the initial value of the variable and xi* is the optimal value of the variable.

Options of the plot method are the x- and y- figure sizes, the quantile level, the use of a logarithmic scale and the possibility to save the influent variables indices as a NumPy file.

Attributes
  • opt_problem (OptimizationProblem) – The optimization problem.

  • database (Database) – The database generated by the optimization problem.

  • out_data_dict (Dict[Any,Any]) – The data dict to eventually rebuild the plot in another framework.

Parameters

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

Raises

ValueError – If the JSON grammar file for the options of the post-processor does not exist.

Return type

None

Methods:

check_options(**options)

Check the options of the post-processor.

execute([save, show, file_path, …])

Post-process the optimization problem.

Attributes:

figures

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

output_files

The paths to the output files.

check_options(**options)

Check the options of the post-processor.

Parameters
  • **options – The options of the post-processor.

  • options (Union[int, float, str, bool, Sequence[str]]) –

Raises

InvalidDataException – If an option is invalid according to the grammar.

Return type

None

execute(save=True, show=False, file_path=None, directory_path=None, file_name=None, file_extension=None, **options)

Post-process the optimization problem.

Parameters
  • save (bool) – If True, save the figure.

  • show (bool) – If True, display the figure.

  • file_path (Optional[Union[str, pathlib.Path]]) – The path of the file to save the figures. If the extension is missing, use file_extension. If None, create a file path from directory_path, file_name and file_extension.

  • directory_path (Optional[Union[str, pathlib.Path]]) – The path of the directory to save the figures. If None, use the current working directory.

  • file_name (Optional[str]) – The name of the file to save the figures. If None, use a default one generated by the post-processing.

  • file_extension (Optional[str]) – A file extension, e.g. ‘png’, ‘pdf’, ‘svg’, … If None, use a default file extension.

  • **options – The options of the post-processor.

  • options (Union[int, float, str, bool, Sequence[str]]) –

Returns

The figure, to be customized if not closed.

Raises

ValueError – If the opt_problem.database is empty.

Return type

Dict[str, matplotlib.figure.Figure]

property figures

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

property output_files

The paths to the output files.