.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/post_process/post_process_file.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_post_process_post_process_file.py: Post-process an HDF5 file. ========================== .. GENERATED FROM PYTHON SOURCE LINES 24-30 .. code-block:: Python from __future__ import annotations from gemseo import execute_post from gemseo import import_database .. GENERATED FROM PYTHON SOURCE LINES 31-37 Given an HDF5 file generated from an :class:`.EvaluationProblem`, an :class:`.OptimizationProblem` or a :class:`.Scenario`, we can visualize the evaluation history using the function :func:`.execute_post` and a specific visualization tool such as ``"BasicHistory"``: .. GENERATED FROM PYTHON SOURCE LINES 37-39 .. code-block:: Python execute_post("my_results.hdf5", post_name="BasicHistory", variable_names=["y_4"]) .. GENERATED FROM PYTHON SOURCE LINES 40-46 .. note:: By default, |g| saves the images on the disk. Use ``save=False`` to not save figures and ``show=True`` to display them on the screen. We can also get the raw data as a :class:`.Database` from this HDF5 file: .. GENERATED FROM PYTHON SOURCE LINES 46-48 .. code-block:: Python database = import_database("my_results.hdf5") .. GENERATED FROM PYTHON SOURCE LINES 49-51 and convert it into a :class:`.Dataset`` to handle it more easily (see :ref:`this example `): .. GENERATED FROM PYTHON SOURCE LINES 51-53 .. code-block:: Python dataset = database.to_dataset() .. GENERATED FROM PYTHON SOURCE LINES 54-59 .. seealso:: - :ref:`sphx_glr_examples_post_process_save_from_scenario.py`, - :ref:`sphx_glr_examples_post_process_save_from_opt_problem.py`, - :ref:`sphx_glr_examples_dataset_creation_plot_optimization_dataset.py`. .. _sphx_glr_download_examples_post_process_post_process_file.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: post_process_file.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: post_process_file.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: post_process_file.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_