diff --git a/doc/source/_static/banner_api.png b/doc/source/_static/banner_api.png new file mode 100644 index 000000000..45b6dbfa6 Binary files /dev/null and b/doc/source/_static/banner_api.png differ diff --git a/doc/source/_static/banner_osl_server.png b/doc/source/_static/banner_osl_server.png new file mode 100644 index 000000000..ac2097ae8 Binary files /dev/null and b/doc/source/_static/banner_osl_server.png differ diff --git a/doc/source/_static/banner_python_scripts.png b/doc/source/_static/banner_python_scripts.png new file mode 100644 index 000000000..20f36f4d4 Binary files /dev/null and b/doc/source/_static/banner_python_scripts.png differ diff --git a/doc/source/conf.py b/doc/source/conf.py index 277b0bd19..a6f804212 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -28,6 +28,7 @@ "sphinx.ext.doctest", "sphinx.ext.extlinks", "sphinx.ext.intersphinx", + "sphinx_design", "sphinx_copybutton", "sphinx_gallery.gen_gallery", "ansys_sphinx_theme.extension.linkcode", @@ -118,7 +119,7 @@ # path to your examples scripts "examples_dirs": ["../../examples/"], # path where to save gallery generated examples - "gallery_dirs": ["examples"], + "gallery_dirs": ["examples/gallery_examples"], # Pattern to search for example files "filename_pattern": r"\.py", # Remove the "Download all examples" button from the top level gallery diff --git a/doc/source/examples/index.rst b/doc/source/examples/index.rst new file mode 100644 index 000000000..e02299615 --- /dev/null +++ b/doc/source/examples/index.rst @@ -0,0 +1,83 @@ +.. toctree:: + :hidden: + :maxdepth: 3 + + gallery_examples/api/index.rst + gallery_examples/evaluate_design/index.rst + gallery_examples/osl_server/index.rst + gallery_examples/parametric_design_study_manager/index.rst + gallery_examples/run_python_script/index.rst + gallery_examples/workflow_creation/index.rst + +.. _ref_examples: + +Examples +======== +End-to-end examples show how you can use PyOptiSLang. If PyOptiSLang is installed +on your machine, you can download these examples as Python files or Jupyter +notebooks and run them locally. + +.. grid:: 2 2 3 3 + :gutter: 1 2 3 3 + :padding: 1 2 3 3 + + .. grid-item-card:: API usage examples + :link: sphx_glr_examples_gallery_examples_api + :link-type: ref + + .. image:: ../_static/banner_api.png + :height: 150px + :align: center + + These examples demonstrate how to use the explixit API to communicate with optiSLang. + + .. grid-item-card:: Evaluate designs + :link: sphx_glr_examples_gallery_examples_evaluate_design + :link-type: ref + + .. image:: ../_static/01_ten_bar_truss_evaluate_design.png + :height: 150px + :align: center + + These examples demonstrate how to evaluate designs. + + .. grid-item-card:: Raw optiSLang server communication + :link: sphx_glr_examples_gallery_examples_osl_server + :link-type: ref + + .. image:: ../_static/banner_osl_server.png + :height: 150px + :align: center + + These examples demonstrate how to use PyOptiSLang to perform raw communiction with the optiSLang server. + + .. grid-item-card:: Parametric Design Study Manager + :link: sphx_glr_examples_gallery_examples_parametric_design_study_manager + :link-type: ref + + .. image:: ../_static/03_1_ProxySolverSensitivity.png + :height: 150px + :align: center + + These examples demonstrate how to create and execute design studies using templates. + + + .. grid-item-card:: Run Python scripts + :link: sphx_glr_examples_gallery_examples_run_python_script + :link-type: ref + + .. image:: ../_static/banner_python_scripts.png + :height: 150px + :align: center + + These examples demonstrate how to run Python scripts. + + .. grid-item-card:: Create workflow + :link: sphx_glr_examples_gallery_examples_workflow_creation + :link-type: ref + + .. image:: ../_static/04_1_RDO_w_python.png + :height: 150px + :align: center + + These examples demonstrate how to create workflow using pyOptiSLang. diff --git a/examples/evaluate_design/01_ten_bar_truss.py b/examples/evaluate_design/01_ten_bar_truss.py index d3dba91e3..7e774a16f 100644 --- a/examples/evaluate_design/01_ten_bar_truss.py +++ b/examples/evaluate_design/01_ten_bar_truss.py @@ -51,7 +51,7 @@ ######################################################### # Workflow: -# .. image:: ../../_static/01_ten_bar_truss_evaluate_design.png +# .. image:: ../../../_static/01_ten_bar_truss_evaluate_design.png # :width: 400 # :alt: Result of script. # @@ -62,6 +62,10 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~ # Perform the required imports. +# sphinx_gallery_start_ignore +# sphinx_gallery_thumbnail_path = "../../doc/source/_static/01_ten_bar_truss_evaluate_design.png" +# sphinx_gallery_end_ignore + from pathlib import Path import tempfile from typing import TYPE_CHECKING, List diff --git a/examples/parametric_design_study_manager/01_general_algorithm.py b/examples/parametric_design_study_manager/01_general_algorithm.py index de95b9c03..cfef93898 100644 --- a/examples/parametric_design_study_manager/01_general_algorithm.py +++ b/examples/parametric_design_study_manager/01_general_algorithm.py @@ -36,6 +36,9 @@ # ------------------------ # Perform the required imports. +# sphinx_gallery_start_ignore +# sphinx_gallery_thumbnail_path = "../../doc/source/_static/01_general_algorithm.png" +# sphinx_gallery_end_ignore from math import sin from pathlib import Path @@ -132,6 +135,6 @@ def callback(designs: list[Design]) -> list[Design]: # ----------------------- # This image shows the generated workflow. # -# .. image:: ../../_static/01_general_algorithm.png +# .. image:: ../../../_static/01_general_algorithm.png # :width: 400 # :alt: Result of script. diff --git a/examples/parametric_design_study_manager/02_optimization_on_mop.py b/examples/parametric_design_study_manager/02_optimization_on_mop.py index c3f404801..382b3fc8a 100644 --- a/examples/parametric_design_study_manager/02_optimization_on_mop.py +++ b/examples/parametric_design_study_manager/02_optimization_on_mop.py @@ -36,6 +36,9 @@ # ------------------------ # Perform the required imports. +# sphinx_gallery_start_ignore +# sphinx_gallery_thumbnail_path = "../../doc/source/_static/02_optimization_on_mop.png" +# sphinx_gallery_end_ignore from math import sin from pathlib import Path @@ -154,6 +157,6 @@ def callback(designs: list[Design]) -> list[Design]: # ----------------------- # This image shows the generated workflow. # -# .. image:: ../../_static/02_optimization_on_mop.png +# .. image:: ../../../_static/02_optimization_on_mop.png # :width: 1200 # :alt: Result of script. diff --git a/examples/run_python_script/01_ten_bar_truss.py b/examples/run_python_script/01_ten_bar_truss.py index 2a8181e02..f12981698 100644 --- a/examples/run_python_script/01_ten_bar_truss.py +++ b/examples/run_python_script/01_ten_bar_truss.py @@ -40,6 +40,10 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~ # Perform the required imports. +# sphinx_gallery_start_ignore +# sphinx_gallery_thumbnail_path = "../../doc/source/_static/01_ten_bar_truss.png" +# sphinx_gallery_end_ignore + from ansys.optislang.core import Optislang import ansys.optislang.core.examples as examples @@ -96,7 +100,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~ # This image shows the generated workflow. # -# .. image:: ../../_static/01_ten_bar_truss.png +# .. image:: ../../../_static/01_ten_bar_truss.png # :width: 400 # :alt: Result of script. # diff --git a/examples/run_python_script/02_1_oscillator_robustness.py b/examples/run_python_script/02_1_oscillator_robustness.py index 102465331..9d2634ef9 100644 --- a/examples/run_python_script/02_1_oscillator_robustness.py +++ b/examples/run_python_script/02_1_oscillator_robustness.py @@ -38,6 +38,10 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~ # Perform the required imports. +# sphinx_gallery_start_ignore +# sphinx_gallery_thumbnail_path = "../../doc/source/_static/02_1_oscillator_robustness.png" +# sphinx_gallery_end_ignore + from ansys.optislang.core import Optislang import ansys.optislang.core.examples as examples @@ -88,7 +92,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~ # This image shows the generated workflow. # -# .. image:: ../../_static/02_1_oscillator_robustness.png +# .. image:: ../../../_static/02_1_oscillator_robustness.png # :width: 600 # :alt: Result of script. # diff --git a/examples/run_python_script/02_2_oscillator_python_system.py b/examples/run_python_script/02_2_oscillator_python_system.py index b3790fa1d..95403146e 100644 --- a/examples/run_python_script/02_2_oscillator_python_system.py +++ b/examples/run_python_script/02_2_oscillator_python_system.py @@ -38,6 +38,10 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~ # Perform the required imports. +# sphinx_gallery_start_ignore +# sphinx_gallery_thumbnail_path = "../../doc/source/_static/02_2_python_system.png" +# sphinx_gallery_end_ignore + from ansys.optislang.core import Optislang import ansys.optislang.core.examples as examples @@ -89,7 +93,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~ # This image shows the generated workflow. # -# .. image:: ../../_static/02_2_python_system.png +# .. image:: ../../../_static/02_2_python_system.png # :width: 300 # :alt: Result of script. # diff --git a/examples/run_python_script/02_3_oscillator_optimization_on_EA.py b/examples/run_python_script/02_3_oscillator_optimization_on_EA.py index 3892e384d..882f31d3b 100644 --- a/examples/run_python_script/02_3_oscillator_optimization_on_EA.py +++ b/examples/run_python_script/02_3_oscillator_optimization_on_EA.py @@ -39,6 +39,10 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~ # Perform the required imports. +# sphinx_gallery_start_ignore +# sphinx_gallery_thumbnail_path = "../../doc/source/_static/02_3_optimization_on_EA.png" +# sphinx_gallery_end_ignore + from ansys.optislang.core import Optislang import ansys.optislang.core.examples as examples @@ -90,7 +94,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~ # This image shows the generated workflow. # -# .. image:: ../../_static/02_3_optimization_on_EA.png +# .. image:: ../../../_static/02_3_optimization_on_EA.png # :width: 400 # :alt: Result of script. # diff --git a/examples/run_python_script/02_4_oscillator_MOP_sensitivity_and_optimization.py b/examples/run_python_script/02_4_oscillator_MOP_sensitivity_and_optimization.py index da4e035ab..986595b06 100644 --- a/examples/run_python_script/02_4_oscillator_MOP_sensitivity_and_optimization.py +++ b/examples/run_python_script/02_4_oscillator_MOP_sensitivity_and_optimization.py @@ -41,6 +41,10 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~ # Perform the required imports. +# sphinx_gallery_start_ignore +# sphinx_gallery_thumbnail_path = "../../doc/source/_static/02_4_oscillator_MOP_sensitivity_and_optimization.png" +# sphinx_gallery_end_ignore + from ansys.optislang.core import Optislang import ansys.optislang.core.examples as examples @@ -95,7 +99,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~ # This image shows the generated workflow. # -# .. image:: ../../_static/02_4_oscillator_MOP_sensitivity_and_optimization.png +# .. image:: ../../../_static/02_4_oscillator_MOP_sensitivity_and_optimization.png # :width: 600 # :alt: Result of script. # diff --git a/examples/run_python_script/02_5_oscillator_calibration_systems.py b/examples/run_python_script/02_5_oscillator_calibration_systems.py index 0e9e148d2..4bf17a073 100644 --- a/examples/run_python_script/02_5_oscillator_calibration_systems.py +++ b/examples/run_python_script/02_5_oscillator_calibration_systems.py @@ -41,6 +41,10 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~ # Perform the required imports. +# sphinx_gallery_start_ignore +# sphinx_gallery_thumbnail_path = "../../doc/source/_static/02_5_oscillator_calibration_systems.png" +# sphinx_gallery_end_ignore + from ansys.optislang.core import Optislang import ansys.optislang.core.examples as examples @@ -95,7 +99,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~ # This image shows the generated workflow. # -# .. image:: ../../_static/02_5_oscillator_calibration_systems.png +# .. image:: ../../../_static/02_5_oscillator_calibration_systems.png # :width: 400 # :alt: Result of script. # diff --git a/examples/run_python_script/03_etk_abaqus.py b/examples/run_python_script/03_etk_abaqus.py index 86204f59c..f0e270140 100644 --- a/examples/run_python_script/03_etk_abaqus.py +++ b/examples/run_python_script/03_etk_abaqus.py @@ -39,6 +39,10 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~ # Perform the required imports. +# sphinx_gallery_start_ignore +# sphinx_gallery_thumbnail_path = "../../doc/source/_static/03_etk_abaqus.png" +# sphinx_gallery_end_ignore + from ansys.optislang.core import Optislang import ansys.optislang.core.examples as examples @@ -83,7 +87,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~ # This image shows the generated workflow. # -# .. image:: ../../_static/03_etk_abaqus.png +# .. image:: ../../../_static/03_etk_abaqus.png # :width: 400 # :alt: Result of script. # diff --git a/examples/run_python_script/04_python_node_and_help.py b/examples/run_python_script/04_python_node_and_help.py index 7e72d58a4..0576fb327 100644 --- a/examples/run_python_script/04_python_node_and_help.py +++ b/examples/run_python_script/04_python_node_and_help.py @@ -45,6 +45,10 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~ # Perform the required imports. +# sphinx_gallery_start_ignore +# sphinx_gallery_thumbnail_path = "../../doc/source/_static/04_python_node_and_help.png" +# sphinx_gallery_end_ignore + from ansys.optislang.core import Optislang import ansys.optislang.core.examples as examples @@ -91,7 +95,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~ # This image shows the generated workflow. # -# .. image:: ../../_static/04_python_node_and_help.png +# .. image:: ../../../_static/04_python_node_and_help.png # :width: 300 # :alt: Result of script. # diff --git a/examples/run_python_script/05_optimizer_settings.py b/examples/run_python_script/05_optimizer_settings.py index edbde658f..f6e8c7ad8 100644 --- a/examples/run_python_script/05_optimizer_settings.py +++ b/examples/run_python_script/05_optimizer_settings.py @@ -38,6 +38,10 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~ # Perform the required imports. +# sphinx_gallery_start_ignore +# sphinx_gallery_thumbnail_path = "../../doc/source/_static/05_optimizer_settings.png" +# sphinx_gallery_end_ignore + from ansys.optislang.core import Optislang import ansys.optislang.core.examples as examples @@ -82,7 +86,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~ # This image shows the generated workflow. # -# .. image:: ../../_static/05_optimizer_settings.png +# .. image:: ../../../_static/05_optimizer_settings.png # :width: 300 # :alt: Result of script. # diff --git a/examples/run_python_script/06_sensitivity_settings.py b/examples/run_python_script/06_sensitivity_settings.py index b9d374eba..ffa0317f7 100644 --- a/examples/run_python_script/06_sensitivity_settings.py +++ b/examples/run_python_script/06_sensitivity_settings.py @@ -38,6 +38,10 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~ # Perform the required imports. +# sphinx_gallery_start_ignore +# sphinx_gallery_thumbnail_path = "../../doc/source/_static/06_sensitivity_settings.png" +# sphinx_gallery_end_ignore + from ansys.optislang.core import Optislang import ansys.optislang.core.examples as examples @@ -82,7 +86,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~ # This image shows the generated workflow. # -# .. image:: ../../_static/06_sensitivity_settings.png +# .. image:: ../../../_static/06_sensitivity_settings.png # :width: 300 # :alt: Result of script. # diff --git a/examples/run_python_script/07_simple_calculator.py b/examples/run_python_script/07_simple_calculator.py index 04468c5a7..5eec02af2 100644 --- a/examples/run_python_script/07_simple_calculator.py +++ b/examples/run_python_script/07_simple_calculator.py @@ -37,6 +37,11 @@ # Perform required imports # ~~~~~~~~~~~~~~~~~~~~~~~~ # Perform the required imports. + +# sphinx_gallery_start_ignore +# sphinx_gallery_thumbnail_path = "../../doc/source/_static/07_simple_calculator.png" +# sphinx_gallery_end_ignore + from ansys.optislang.core import Optislang import ansys.optislang.core.examples as examples @@ -87,7 +92,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~ # This image shows the generated workflow. # -# .. image:: ../../_static/07_simple_calculator.png +# .. image:: ../../../_static/07_simple_calculator.png # :width: 400 # :alt: Result of script. # diff --git a/examples/workflow_creation/01_ten_bar_truss.py b/examples/workflow_creation/01_ten_bar_truss.py index 6f5957815..c991cb811 100644 --- a/examples/workflow_creation/01_ten_bar_truss.py +++ b/examples/workflow_creation/01_ten_bar_truss.py @@ -38,6 +38,10 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~ # Perform the required imports. +# sphinx_gallery_start_ignore +# sphinx_gallery_thumbnail_path = "../../doc/source/_static/01_ten_bar_truss_pyOSL_workflow.png" +# sphinx_gallery_end_ignore + import os from pathlib import Path @@ -378,7 +382,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~ # This image shows the generated workflow. # -# .. image:: ../../_static/01_ten_bar_truss_pyOSL_workflow.png +# .. image:: ../../../_static/01_ten_bar_truss_pyOSL_workflow.png # :width: 400 # :alt: Result of script. # diff --git a/examples/workflow_creation/02_3_oscillator_optimization_on_EA.py b/examples/workflow_creation/02_3_oscillator_optimization_on_EA.py index 887f50bc6..e671cc148 100644 --- a/examples/workflow_creation/02_3_oscillator_optimization_on_EA.py +++ b/examples/workflow_creation/02_3_oscillator_optimization_on_EA.py @@ -38,6 +38,10 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~ # Perform the required imports. +# sphinx_gallery_start_ignore +# sphinx_gallery_thumbnail_path = "../../doc/source/_static/02_3_optimization_on_EA_pyOSL_workflow.png" +# sphinx_gallery_end_ignore + import os from pathlib import Path @@ -190,7 +194,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~ # This image shows the generated workflow. # -# .. image:: ../../_static/02_3_optimization_on_EA_pyOSL_workflow.png +# .. image:: ../../../_static/02_3_optimization_on_EA_pyOSL_workflow.png # :width: 400 # :alt: Result of script. # diff --git a/examples/workflow_creation/03_1_proxy_solver_sensitivity.py b/examples/workflow_creation/03_1_proxy_solver_sensitivity.py index f4b00197b..73e42a121 100644 --- a/examples/workflow_creation/03_1_proxy_solver_sensitivity.py +++ b/examples/workflow_creation/03_1_proxy_solver_sensitivity.py @@ -73,6 +73,11 @@ # ``node_types`` for algorithm and solver type constants, # ``DesignFlow``/``ParametricSystem``/``ProxySolverNode`` for workflow construction, # and parametric classes for defining parameters, criteria, and bounds. + +# sphinx_gallery_start_ignore +# sphinx_gallery_thumbnail_path = "../../doc/source/_static/03_1_ProxySolverSensitivity.png" +# sphinx_gallery_end_ignore + import time from ansys.optislang.core import Optislang @@ -297,7 +302,7 @@ def calculate(designs): # This image shows the generated workflow. # However, it is important to note, that this workflow is only usable through pyoptislang and cannot be used interactively! # -# .. image:: ../../_static/03_1_ProxySolverSensitivity.png +# .. image:: ../../../_static/03_1_ProxySolverSensitivity.png # :width: 400 # :alt: Result of script. # diff --git a/examples/workflow_creation/03_2_proxy_solver_amop.py b/examples/workflow_creation/03_2_proxy_solver_amop.py index bc8d99d22..b7f9e1770 100644 --- a/examples/workflow_creation/03_2_proxy_solver_amop.py +++ b/examples/workflow_creation/03_2_proxy_solver_amop.py @@ -75,6 +75,11 @@ # ``node_types`` for algorithm and solver type constants, # ``DesignFlow``/``ParametricSystem``/``ProxySolverNode`` for workflow construction, # and parametric classes for defining parameters, criteria, and bounds. + +# sphinx_gallery_start_ignore +# sphinx_gallery_thumbnail_path = "../../doc/source/_static/03_2_ProxySolverAMOP.png" +# sphinx_gallery_end_ignore + import time from ansys.optislang.core import Optislang @@ -299,7 +304,7 @@ def calculate(designs): # This image shows the generated workflow. # However, it is important to note, that this workflow is only usable through pyoptislang and cannot be used interactively! # -# .. image:: ../../_static/03_2_ProxySolverAMOP.png +# .. image:: ../../../_static/03_2_ProxySolverAMOP.png # :width: 400 # :alt: Result of script. # diff --git a/examples/workflow_creation/03_3_proxy_solver_oco.py b/examples/workflow_creation/03_3_proxy_solver_oco.py index 5eefa878b..fb17c4a81 100644 --- a/examples/workflow_creation/03_3_proxy_solver_oco.py +++ b/examples/workflow_creation/03_3_proxy_solver_oco.py @@ -77,6 +77,11 @@ # ``node_types`` for algorithm and solver type constants, # ``DesignFlow``/``ParametricSystem``/``ProxySolverNode`` for workflow construction, # and parametric classes for defining parameters, criteria, and bounds. + +# sphinx_gallery_start_ignore +# sphinx_gallery_thumbnail_path = "../../doc/source/_static/03_3_ProxySolverOCO.png" +# sphinx_gallery_end_ignore + import time from ansys.optislang.core import Optislang @@ -314,7 +319,7 @@ def calculate(designs): # This image shows the generated workflow. # However, it is important to note, that this workflow is only usable through pyoptislang and cannot be used interactively! # -# .. image:: ../../_static/03_3_ProxySolverOCO.png +# .. image:: ../../../_static/03_3_ProxySolverOCO.png # :width: 400 # :alt: Result of script. # diff --git a/examples/workflow_creation/04_1_rdo_python.py b/examples/workflow_creation/04_1_rdo_python.py index 191db4603..bf4498d8d 100644 --- a/examples/workflow_creation/04_1_rdo_python.py +++ b/examples/workflow_creation/04_1_rdo_python.py @@ -36,6 +36,10 @@ # ------------------------ # Perform the required imports. +# sphinx_gallery_start_ignore +# sphinx_gallery_thumbnail_path = "../../doc/source/_static/04_1_RDO_w_python.png" +# sphinx_gallery_end_ignore + from typing import Union from ansys.optislang.core import Optislang @@ -441,6 +445,6 @@ def add_solver_node_to_parent_system( # ----------------------- # This image shows the generated workflow. # -# .. image:: ../../_static/04_1_RDO_w_python.png +# .. image:: ../../../_static/04_1_RDO_w_python.png # :width: 1200 # :alt: Result of script. diff --git a/examples/workflow_creation/04_2_rdo_proxy_solver.py b/examples/workflow_creation/04_2_rdo_proxy_solver.py index b310195f4..26cb5c9bd 100644 --- a/examples/workflow_creation/04_2_rdo_proxy_solver.py +++ b/examples/workflow_creation/04_2_rdo_proxy_solver.py @@ -36,6 +36,10 @@ # ------------------------ # Perform the required imports. +# sphinx_gallery_start_ignore +# sphinx_gallery_thumbnail_path = "../../doc/source/_static/04_2_RDO_w_proxysolver.png" +# sphinx_gallery_end_ignore + import time from typing import Union @@ -656,6 +660,6 @@ def run_proxy_solver_in_parent_system(osl: Optislang, solver: ProxySolverNode): # ----------------------- # This image shows the generated workflow. # -# .. image:: ../../_static/04_2_RDO_w_proxysolver.png +# .. image:: ../../../_static/04_2_RDO_w_proxysolver.png # :width: 1200 # :alt: Result of script. diff --git a/pyproject.toml b/pyproject.toml index 5b7a3ccc5..30eb542b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,7 +51,8 @@ doc = [ "quarto-cli==1.9.37", "Sphinx==9.0.4", "sphinx-copybutton==0.5.2", - "sphinx-gallery==0.21.0" + "sphinx-gallery==0.21.0", + "sphinx-design==0.7.0", ] build = [ "build>=0.8.0", diff --git a/src/ansys/optislang/parametric/design_study.py b/src/ansys/optislang/parametric/design_study.py index 0dad70063..b779f8346 100644 --- a/src/ansys/optislang/parametric/design_study.py +++ b/src/ansys/optislang/parametric/design_study.py @@ -430,6 +430,19 @@ def execution_order(self) -> Tuple[ExecutableBlock, ...]: """ return tuple(self.__execution_blocks) + @property + def executed_proxy_solver(self) -> Optional[ProxySolverNode]: + """Get instance of proxy solver node being executed. + + Applicable when `start_in_thread` was called. + + Returns + ------- + Optional[ProxySolverNode] + Instance of proxy solver node. + """ + return self.__current_proxy_solver + @property def is_complete(self) -> bool: """Get info if design study is finished.