.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/run_python_script/06_sensitivity_settings.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_run_python_script_06_sensitivity_settings.py: .. _ref_sensitivity_settings: Sensitivity settings -------------------- This example demonstrates how to create and configure sensitivity systems. It creates a system named "Sensitivity". It then finds this system and uses the ``sensitivity_settings.py`` file to change some of the settings. Lastly, it explains how you can optionally save the project to a desired location. .. GENERATED FROM PYTHON SOURCE LINES 37-40 Perform required imports ~~~~~~~~~~~~~~~~~~~~~~~~ Perform the required imports. .. GENERATED FROM PYTHON SOURCE LINES 40-44 .. code-block:: Python from ansys.optislang.core import Optislang import ansys.optislang.core.examples as examples .. GENERATED FROM PYTHON SOURCE LINES 45-48 Create optiSLang instance ~~~~~~~~~~~~~~~~~~~~~~~~~ Create the optiSLang instance. .. GENERATED FROM PYTHON SOURCE LINES 48-52 .. code-block:: Python osl = Optislang(ini_timeout=60) print(osl) .. GENERATED FROM PYTHON SOURCE LINES 53-57 Get path of example script and run it ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Get the path of the example script and then run this script. .. GENERATED FROM PYTHON SOURCE LINES 57-61 .. code-block:: Python paths = examples.get_files("sensitivity_settings") osl.application.project.run_python_file(paths[0]) .. GENERATED FROM PYTHON SOURCE LINES 62-72 Optionally save project ~~~~~~~~~~~~~~~~~~~~~~~ If you want to save the project to some desired location, uncomment and edit these lines: .. code:: python path = r'' osl.application.save_as(os.path.join(path, "test_project.opf")) .. GENERATED FROM PYTHON SOURCE LINES 74-77 Stop and cancel project ~~~~~~~~~~~~~~~~~~~~~~~ Stop and cancel the project. .. GENERATED FROM PYTHON SOURCE LINES 77-80 .. code-block:: Python osl.dispose() .. GENERATED FROM PYTHON SOURCE LINES 81-89 View generated workflow ~~~~~~~~~~~~~~~~~~~~~~~ This image shows the generated workflow. .. image:: ../../_static/06_sensitivity_settings.png :width: 300 :alt: Result of script. .. _sphx_glr_download_examples_run_python_script_06_sensitivity_settings.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 06_sensitivity_settings.ipynb <06_sensitivity_settings.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 06_sensitivity_settings.py <06_sensitivity_settings.py>` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: 06_sensitivity_settings.zip <06_sensitivity_settings.zip>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_