.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/api/plot_doe.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_api_plot_doe.py: DOE algorithms ============== In this example, we will discover the different functions of the API related to design of experiments. .. GENERATED FROM PYTHON SOURCE LINES 29-35 .. code-block:: Python from __future__ import annotations from gemseo import get_algorithm_options_schema from gemseo import get_available_doe_algorithms .. GENERATED FROM PYTHON SOURCE LINES 36-41 Get available DOE algorithms ---------------------------- The :func:`.get_available_doe_algorithms` function returns the list of optimization algorithms available in |g| or in external modules .. GENERATED FROM PYTHON SOURCE LINES 41-43 .. code-block:: Python get_available_doe_algorithms() .. rst-class:: sphx-glr-script-out .. code-block:: none ['CustomDOE', 'DiagonalDOE', 'MorrisDOE', 'OATDOE', 'OT_SOBOL', 'OT_RANDOM', 'OT_HASELGROVE', 'OT_REVERSE_HALTON', 'OT_HALTON', 'OT_FAURE', 'OT_MONTE_CARLO', 'OT_FACTORIAL', 'OT_COMPOSITE', 'OT_AXIAL', 'OT_OPT_LHS', 'OT_LHS', 'OT_LHSC', 'OT_FULLFACT', 'OT_SOBOL_INDICES', 'PYDOE_BBDESIGN', 'PYDOE_CCDESIGN', 'PYDOE_FF2N', 'PYDOE_FULLFACT', 'PYDOE_LHS', 'PYDOE_PBDESIGN', 'Halton', 'LHS', 'MC', 'PoissonDisk', 'Sobol'] .. GENERATED FROM PYTHON SOURCE LINES 44-48 Get options schema ------------------ For a given optimization algorithm, e.g. ``"DiagonalDOE"``, we can get the options; e.g. .. GENERATED FROM PYTHON SOURCE LINES 48-50 .. code-block:: Python get_algorithm_options_schema("DiagonalDOE") .. rst-class:: sphx-glr-script-out .. code-block:: none {'$defs': {'ProgressBarDataName': {'enum': ['ProgressBarData'], 'title': 'ProgressBarDataName', 'type': 'string'}}, 'additionalProperties': False, 'description': 'The settings of the diagonal DOE for scalable model construction.', 'properties': {'enable_progress_bar': {'anyOf': [{'type': 'boolean'}, {'type': 'null'}], 'default': None, 'description': 'Whether to enable the progress bar in the optimization log.\n\nIf ``None``, use the global value of ``enable_progress_bar`` (see the\n``configure`` function to change it globally).', 'title': 'Enable Progress Bar'}, 'eq_tolerance': {'default': 0.01, 'description': 'The tolerance on the equality constraints.', 'minimum': 0, 'title': 'Eq Tolerance', 'type': 'number'}, 'ineq_tolerance': {'default': 0.0001, 'description': 'The tolerance on the inequality constraints.', 'minimum': 0, 'title': 'Ineq Tolerance', 'type': 'number'}, 'log_problem': {'default': True, 'description': 'Whether to log the definition and result of the problem.', 'title': 'Log Problem', 'type': 'boolean'}, 'max_time': {'default': 0.0, 'description': 'The maximum runtime in seconds, disabled if 0.', 'minimum': 0, 'title': 'Max Time', 'type': 'number'}, 'normalize_design_space': {'default': False, 'description': 'Whether to normalize the design space variables between 0 and 1.', 'title': 'Normalize Design Space', 'type': 'boolean'}, 'progress_bar_data_name': {'$ref': '#/$defs/ProgressBarDataName', 'default': 'ProgressBarData', 'description': 'The name of a :class:`.BaseProgressBarData` class\nto define the data of an evaluation problem to be displayed in the progress bar.'}, 'reset_iteration_counters': {'default': True, 'description': 'Whether to reset the iteration counters before each execution.', 'title': 'Reset Iteration Counters', 'type': 'boolean'}, 'round_ints': {'default': True, 'description': 'Whether to round the integer variables.', 'title': 'Round Ints', 'type': 'boolean'}, 'store_jacobian': {'default': True, 'description': 'Whether to store the Jacobian matrices in the database.\n\n This argument is ignored when the ``use_database`` option is ``False``.\n If a gradient-based algorithm is used,\n this option cannot be set along with kkt options.', 'title': 'Store Jacobian', 'type': 'boolean'}, 'use_database': {'default': True, 'description': 'Whether to wrap the functions in the database.', 'title': 'Use Database', 'type': 'boolean'}, 'use_one_line_progress_bar': {'default': False, 'description': 'Whether to log the progress bar on a single line.', 'title': 'Use One Line Progress Bar', 'type': 'boolean'}, 'eval_func': {'default': True, 'description': 'Whether to sample the function computing the output values.', 'title': 'Eval Func', 'type': 'boolean'}, 'eval_jac': {'default': False, 'description': 'Whether to sample the function computing the Jacobian data.', 'title': 'Eval Jac', 'type': 'boolean'}, 'n_processes': {'default': 1, 'description': 'The maximum number of processes to parallelize the execution.', 'exclusiveMinimum': 0, 'title': 'N Processes', 'type': 'integer'}, 'wait_time_between_samples': {'default': 0.0, 'description': 'The time to wait between each sample evaluation, in seconds.', 'minimum': 0, 'title': 'Wait Time Between Samples', 'type': 'number'}, 'callbacks': {'default': [], 'description': 'The functions called after evaluating the function of interest.\n\nA callback must be called as ``callback(sample_index, (output, Jacobian))``.', 'items': {}, 'title': 'Callbacks', 'type': 'array'}, 'preprocessors': {'default': [], 'description': 'The functions called\nbefore evaluating the function of interest.\n\nA preprocessor must be called as ``preprocessor(sample_index)``.\n\nThis option is not compatible with the vectorization of functions evaluations.\n', 'items': {}, 'title': 'Preprocessors', 'type': 'array'}, 'vectorize': {'default': False, 'description': 'Whether to vectorize the functions evaluations.', 'title': 'Vectorize', 'type': 'boolean'}, 'n_samples': {'default': 2, 'description': 'The number of samples.\n\nThe number of samples must be greater than or equal than 2.', 'minimum': 2, 'title': 'N Samples', 'type': 'integer'}, 'reverse': {'default': [], 'description': 'The dimensions or variables to sample from upper to lower bounds.\n\nIf empty, every dimension will be sampled from lower to upper bounds.', 'items': {'type': 'string'}, 'title': 'Reverse', 'type': 'array'}}, 'title': 'DiagonalDOE_Settings', 'type': 'object'} .. GENERATED FROM PYTHON SOURCE LINES 51-53 Or import its settings model and pass it directly with the keyword "algo_settings_model". .. GENERATED FROM PYTHON SOURCE LINES 53-57 .. code-block:: Python from gemseo.settings.doe import DiagonalDOE_Settings # noqa: E402 settings_model = DiagonalDOE_Settings() .. GENERATED FROM PYTHON SOURCE LINES 58-59 See :ref:`algorithm_settings` for more information on how to use settings models. .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.003 seconds) .. _sphx_glr_download_examples_api_plot_doe.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_doe.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_doe.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_doe.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_