diff --git a/doc/source/conf.py b/doc/source/conf.py index 571e9f8bff..b80e9b25f7 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -87,6 +87,7 @@ "sphinx_design", "sphinx_gallery.gen_gallery", 'sphinx_reredirects', + "jupyter_sphinx", ] redirects = { diff --git a/doc/source/user_guide/custom_operators.rst b/doc/source/user_guide/custom_operators.rst deleted file mode 100644 index 1e211bd5b0..0000000000 --- a/doc/source/user_guide/custom_operators.rst +++ /dev/null @@ -1,253 +0,0 @@ -.. _user_guide_custom_operators: - -================ -Custom operators -================ - -In Ansys 2023 R1 and later, you can create custom operators in CPython. Creating custom operators -consists of wrapping Python routines in a DPF-compliant way so that you can access them in the same way -as you access the native operators in the :class:`ansys.dpf.core.dpf_operator.Operator` class in -PyDPF-Core or in any supported client API. - -With support for custom operators, PyDPF-Core becomes a development tool offering: - -- **Accessibility:** A simple script can define a basic operator plugin. - -- **Componentization:** Operators with similar applications can be grouped in Python plug-in packages. - -- **Easy distribution:** Standard Python tools can be used to package, upload, and download custom operators. - -- **Dependency management:** Third-party Python modules can be added to the Python package. - -- **Reusability:** A documented and packaged operator can be reused in an infinite number of workflows. - -- **Remotable and parallel computing:** Native DPF capabilities are inherited by custom operators. - -The only prerequisite for creating custom operators is to be familiar with native operators. -For more information, see :ref:`ref_user_guide_operators`. - -Install module --------------- - -Once an Ansys-unified installation is complete, you must install the ``ansys-dpf-core`` module in the Ansys -installer's Python interpreter. - -#. Download the script for you operating system: - - - For Windows, download this :download:`PowerShell script `. - - For Linux, download this :download:`Shell script ` - -#. Run the downloaded script for installing with optional arguments: - - - ``-awp_root``: Path to the Ansys root installation folder. For example, the 2023 R1 installation folder ends - with ``Ansys Inc/v231``, and the default environment variable is ``AWP_ROOT231``. - - ``-pip_args``: Optional arguments to add to the ``pip`` command. For example, ``--extra-index-url`` or - ``--trusted-host``. - -If you ever want to uninstall the ``ansys-dpf-core`` module from the Ansys installation, you can do so. - -#. Download the script for your operating system: - - - For Windows, download this :download:`PowerShell script `. - - For Linux, download this :download:`Shell script `. - -3. Run the downloaded script for uninstalling with the optional argument: - - - ``-awp_root``: Path to the Ansys root installation folder. For example, the 2023 R1 installation folder ends - with ``Ansys Inc/v231``, and the default environment variable is ``AWP_ROOT231``. - - -Create operators ----------------- -You can create a basic operator plugin or a plug-in package with multiple operators. - -Basic operator plugin -~~~~~~~~~~~~~~~~~~~~~ -To create a basic operator plugin, you write a simple Python script. An operator implementation -derives from the :class:`ansys.dpf.core.custom_operator.CustomOperatorBase` class and a call to -the :func:`ansys.dpf.core.custom_operator.record_operator` method. - -This example script shows how you create a basic operator plugin: - -.. literalinclude:: custom_operator_example.py - - -.. code-block:: - - def load_operators(*args): - record_operator(CustomOperator, *args) - - -In the various properties for the class, you specify the following: - -- Name for the custom operator -- Description of what the operator does -- Dictionary for each input and output pin, which includes the name, a list of supported types, a description, - and whether it is optional and/or ellipsis (meaning that the specification is valid for pins going from pin - number *x* to infinity) -- List for operator properties, including name to use in the documentation and code generation and the - operator category. The optional ``license`` property allows to define a required license to check out - when running the operator. Set it equal to ``any_dpf_supported_increments`` to allow any license - currently accepted by DPF (see :ref:`here`) - -For comprehensive examples on writing operator plugins, see :ref:`python_operators`. - - -Plug-in package with multiple operators -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -To create a plug-in package with multiple operators or with complex routines, you write a -Python package. The benefits of writing packages rather than simple scripts are: - -- **Componentization:** You can split the code into several Python modules or files. -- **Distribution:** You can use standard Python tools to upload and download packages. -- **Documentation:** You can add README files, documentation, tests, and examples to the package. - -A plug-in package with dependencies consists of a folder with the necessary files. Assume -that the name of your plug-in package is ``custom_plugin``. A folder with this name would -contain four files: - -- ``__init__.py`` -- ``operators.py`` -- ``operators_loader.py`` -- ``common.py`` - -**__init__.py file** - -The ``__init__.py`` file contains this code:: - - from operators_loader import load_operators - - -**operators.py file** - -The ``operators.py`` file contains code like this: - -.. literalinclude:: custom_operator_example.py - - -**operators_loader.py file** - -The ``operators_loader.py`` file contains code like this:: - - from custom_plugin import operators - from ansys.dpf.core.custom_operator import record_operator - - - def load_operators(*args): - record_operator(operators.CustomOperator, *args) - - -**common.py file** - -The ``common.py`` file contains the Python routines as classes and functions:: - - #write needed python routines as classes and functions here. - -Third-party dependencies -^^^^^^^^^^^^^^^^^^^^^^^^ - -.. include:: custom_operators_deps.rst - - -Assume once again that the name of your plug-in package is ``custom_plugin``. -A folder with this name would contain these files: - -- ``__init__.py`` -- ``operators.py`` -- ``operators_loader.py`` -- ``common.py`` -- ``winx64.zip`` -- ``linx64.zip`` -- ``custom_plugin.xml`` - -**__init__.py file** - -The ``__init__.py`` file contains this code:: - - from operators_loader import load_operators - - -**operators.py file** - -The ``operators.py`` file contains code like this: - -.. literalinclude:: custom_operator_example.py - - -**operators_loader.py file** - -The ``operators_loader.py`` file contains code like this:: - - from custom_plugin import operators - from ansys.dpf.core.custom_operator import record_operator - - - def load_operators(*args): - record_operator(operators.CustomOperator, *args) - - - def load_operators(*args): - record_operator(operators.CustomOperator, *args) - -**common.py file** - -The ``common.py`` file contains the Python routines as classes and functions:: - - #write needed python routines as classes and functions here. - - -**requirements.txt file** - -The ``requirements.txt`` file contains code like this: - -.. literalinclude:: /examples/07-python-operators/plugins/gltf_plugin/requirements.txt - -The ZIP files for Windows and Linux are included as assets: - -- ``winx64.zip`` -- ``linx64.zip`` - - -**custom_plugin.xml file** - -The ``custom_plugin.xml`` file contains code like this: - -.. literalinclude:: custom_plugin.xml - :language: xml - - -Use custom operators --------------------- - -Once a custom operator is created, you can use the :func:`ansys.dpf.core.core.load_library` method to load it. -The first argument is the path to the directory with the plugin. The second argument is ``py_`` plus any name -identifying the plugin. The last argument is the function name for recording operators. - -For a plugin that is a single script, the second argument should be ``py_`` plus the name of the Python file: - -.. code:: - - dpf.load_library( - r"path/to/plugins", - "py_custom_plugin", #if the load_operators function is defined in path/to/plugins/custom_plugin.py - "load_operators") - -For a plug-in package, the second argument should be ``py_`` plus any name: - -.. code:: - - dpf.load_library( - r"path/to/plugins/custom_plugin", - "py_my_custom_plugin", #if the load_operators function is defined in path/to/plugins/custom_plugin/__init__.py - "load_operators") - -Once the plugin is loaded, you can instantiate the custom operator: - -.. code:: - - new_operator = dpf.Operator("custom_operator") # if "custom_operator" is what is returned by the ``name`` property - -References ----------- -For more information, see :ref:`ref_custom_operator` in the **API reference** -and :ref:`python_operators` in **Examples**. diff --git a/doc/source/user_guide/how_to.rst b/doc/source/user_guide/how_to.rst index f435986884..fb51c3df75 100644 --- a/doc/source/user_guide/how_to.rst +++ b/doc/source/user_guide/how_to.rst @@ -15,15 +15,6 @@ How-tos .. image:: ../images/plotting/pontoon.png .. image:: ../images/plotting/pontoon_strain.png - - - .. grid-item-card:: Create custom operators - :link: user_guide_custom_operators - :link-type: ref - :text-align: center - - .. image:: ../images/drawings/plugin-logo.png - :width: 50% .. grid-item-card:: Use DPF Server package diff --git a/doc/source/user_guide/index.rst b/doc/source/user_guide/index.rst index 7d1dfab4ae..fe6106c9bf 100644 --- a/doc/source/user_guide/index.rst +++ b/doc/source/user_guide/index.rst @@ -4,24 +4,24 @@ User guide ========== -PyDPF-Core is a Python client API for accessing DPF postprocessing -capabilities. The ``ansys.dpf.core`` package makes highly efficient -computation, customization, and remote postprocessing accessible in Python. +**DPF** provides numerical simulation users and engineers with a toolbox for accessing and +transforming data. -The goals of this section are to: +**PyDPF-Core** is a Python client API for accessing DPF +capabilities. The ``ansys.dpf.core`` package makes highly efficient +computation, customization, and remote data processing accessible in Python. - - Describe the most-used DPF entities and how they can help you to access and modify solver data. - - Provide simple how-tos for tackling the most common use cases. +The goals of this section are to: -.. include:: - concepts/index.rst + - Describe some DPF entities and how they can help you to access and modify solver data. + - Provide detailed tutorials to demonstrate PyDPF-Core functionalities. + - Explain how to resolve the most common issues encountered when using PyDPF-Core .. include:: - main_entities.rst + tutorials/index.rst .. include:: - how_to.rst - + concepts/index.rst Troubleshooting --------------- @@ -52,6 +52,25 @@ Troubleshooting :text-align: center +.. toctree:: + :maxdepth: 2 + :hidden: + :caption: Tutorials + + tutorials/data_structures/index.rst + tutorials/language_and_usage/index.rst + tutorials/post_processing_basics/index.rst + tutorials/import_data/index.rst + tutorials/mesh/index.rst + tutorials/transform_data/index.rst + tutorials/export_data/index.rst + tutorials/plot/index.rst + tutorials/animate/index.rst + tutorials/custom_operators_and_plugins/index.rst + tutorials/distributed_files/index.rst + tutorials/dpf_server/index.rst + tutorials/licensing/index.rst + .. toctree:: :maxdepth: 2 :hidden: @@ -61,30 +80,6 @@ Troubleshooting concepts/waysofusing.rst concepts/stepbystep.rst - -.. toctree:: - :maxdepth: 2 - :hidden: - :caption: DPF most-used entities - - model - operators - fields_container - - -.. toctree:: - :maxdepth: 2 - :hidden: - :caption: How-tos - - plotting.rst - custom_operators.rst - dpf_server.rst - server_types.rst - server_context.rst - xmlfiles.rst - - .. toctree:: :maxdepth: 3 :hidden: diff --git a/doc/source/user_guide/tutorials/animate/index.rst b/doc/source/user_guide/tutorials/animate/index.rst new file mode 100644 index 0000000000..2bfa5b2f4e --- /dev/null +++ b/doc/source/user_guide/tutorials/animate/index.rst @@ -0,0 +1,24 @@ +.. _ref_tutorials_animate: + +======= +Animate +======= + +These tutorials demonstrate how to visualise the data in an animation. + +.. grid:: 1 1 3 3 + :gutter: 2 + :padding: 2 + :margin: 2 + + .. grid-item-card:: Animate data + :link: ref_tutorials + :link-type: ref + :text-align: center + + This tutorial + +.. toctree:: + :maxdepth: 2 + :hidden: + diff --git a/doc/source/user_guide/create_sites_for_python_operators.ps1 b/doc/source/user_guide/tutorials/custom_operators_and_plugins/create_sites_for_python_operators.ps1 similarity index 100% rename from doc/source/user_guide/create_sites_for_python_operators.ps1 rename to doc/source/user_guide/tutorials/custom_operators_and_plugins/create_sites_for_python_operators.ps1 diff --git a/doc/source/user_guide/create_sites_for_python_operators.sh b/doc/source/user_guide/tutorials/custom_operators_and_plugins/create_sites_for_python_operators.sh similarity index 100% rename from doc/source/user_guide/create_sites_for_python_operators.sh rename to doc/source/user_guide/tutorials/custom_operators_and_plugins/create_sites_for_python_operators.sh diff --git a/doc/source/user_guide/custom_operator_example.py b/doc/source/user_guide/tutorials/custom_operators_and_plugins/custom_operator_example.py similarity index 100% rename from doc/source/user_guide/custom_operator_example.py rename to doc/source/user_guide/tutorials/custom_operators_and_plugins/custom_operator_example.py diff --git a/doc/source/user_guide/tutorials/custom_operators_and_plugins/custom_operators.rst b/doc/source/user_guide/tutorials/custom_operators_and_plugins/custom_operators.rst new file mode 100644 index 0000000000..9199468828 --- /dev/null +++ b/doc/source/user_guide/tutorials/custom_operators_and_plugins/custom_operators.rst @@ -0,0 +1,120 @@ +.. _user_guide_custom_operators: + +================ +Custom operators +================ + +In Ansys 2023 R1 and later, you can create custom operators in CPython. Creating custom operators +consists of wrapping Python routines in a DPF-compliant way so that you can access them in the same way +as you access the native operators in the :class:`Operator ` class in +PyDPF-Core or in any supported client API. + +With support for custom operators, PyDPF-Core becomes a development tool offering: + +- **Accessibility:** A simple script can define a basic operator plugin. + +- **Componentization:** Operators with similar applications can be grouped in Python plug-in packages. + +- **Easy distribution:** Standard Python tools can be used to package, upload, and download custom operators. + +- **Dependency management:** Third-party Python modules can be added to the Python package. + +- **Reusability:** A documented and packaged operator can be reused in an infinite number of workflows. + +- **Remotable and parallel computing:** Native DPF capabilities are inherited by custom operators. + +The only prerequisite for creating custom operators is to be familiar with native operators. +For more information, see :ref:`ref_user_guide_operators`. + +Install module +-------------- + +Once an Ansys-unified installation is complete, you must install the ``ansys-dpf-core`` module in the Ansys +installer's Python interpreter. + +#. Download the script for you operating system: + + - For Windows, download this :download:`PowerShell script `. + - For Linux, download this :download:`Shell script ` + +#. Run the downloaded script for installing with optional arguments: + + - ``-awp_root``: Path to the Ansys root installation folder. For example, the 2023 R1 installation folder ends + with ``Ansys Inc/v231``, and the default environment variable is ``AWP_ROOT231``. + - ``-pip_args``: Optional arguments to add to the ``pip`` command. For example, ``--extra-index-url`` or + ``--trusted-host``. + +If you ever want to uninstall the ``ansys-dpf-core`` module from the Ansys installation, you can do so. + +#. Download the script for your operating system: + + - For Windows, download this :download:`PowerShell script `. + - For Linux, download this :download:`Shell script `. + +#. Run the downloaded script for uninstalling with the optional argument: + + - ``-awp_root``: Path to the Ansys root installation folder. For example, the 2023 R1 installation folder ends + with ``Ansys Inc/v231``, and the default environment variable is ``AWP_ROOT231``. + + +Create operators +---------------- + +Creating a basic operator plugin consists of writing a single Python script. An operator implementation +derives from the :class:`CustomOperatorBase ` class and a call to +the :func:`record_operator() ` method. + +This example script shows how you create a basic operator plugin: + +.. literalinclude:: custom_operator_example.py + + +.. code-block:: + + def load_operators(*args): + record_operator(CustomOperator, *args) + + +In the various properties for the class, you specify the following: + +- Name for the custom operator +- Description of what the operator does +- Dictionary for each input and output pin, which includes the name, a list of supported types, a description, + and whether it is optional and/or ellipsis (meaning that the specification is valid for pins going from pin + number *x* to infinity) +- List for operator properties, including name to use in the documentation and code generation and the + operator category. The optional ``license`` property allows to define a required license to check out + when running the operator. Set it equal to ``any_dpf_supported_increments`` to allow any license + currently accepted by DPF (see :ref:`here`) + +For specific examples on writing operator plugins, see :ref:`python_operators`. + +Load the plug-in +---------------- + +Once a custom operator is created, you can use the :func:`load_library() ` method to load it. + +- The first argument is the path to the directory with the plugin. +- The second argument is ``py_``, where is the name identifying the plug-in (same name of the Python file). +- The third argument is the function name for recording operators. + +.. code:: + + dpf.load_library( + r"path/to/plugins", + "py_custom_plugin", #if the load_operators function is defined in path/to/plugins/custom_plugin.py + "load_operators") + +Use custom operators +-------------------- + +Once the plugin is loaded, you can instantiate the custom operator: + +.. code:: + + new_operator = dpf.Operator("custom_operator") # if "custom_operator" is what is returned by the ``name`` property + +References +---------- +For more information, see :ref:`ref_custom_operator` in the **API reference** +and :ref:`python_operators` in **Examples**. diff --git a/doc/source/user_guide/custom_operators_deps.rst b/doc/source/user_guide/tutorials/custom_operators_and_plugins/custom_operators_deps.rst similarity index 92% rename from doc/source/user_guide/custom_operators_deps.rst rename to doc/source/user_guide/tutorials/custom_operators_and_plugins/custom_operators_deps.rst index 754b587947..5122b239ff 100644 --- a/doc/source/user_guide/custom_operators_deps.rst +++ b/doc/source/user_guide/tutorials/custom_operators_and_plugins/custom_operators_deps.rst @@ -23,8 +23,8 @@ For this approach, do the following: #. Download the script for your operating system: - - For Windows, download this :download:`PowerShell script `. - - For Linux, download this :download:`Shell script `. + - For Windows, download this :download:`PowerShell script `. + - For Linux, download this :download:`Shell script `. 3. Run the downloaded script with the mandatory arguments: diff --git a/doc/source/user_guide/tutorials/custom_operators_and_plugins/custom_plug_in_package.rst b/doc/source/user_guide/tutorials/custom_operators_and_plugins/custom_plug_in_package.rst new file mode 100644 index 0000000000..8d39c2fc34 --- /dev/null +++ b/doc/source/user_guide/tutorials/custom_operators_and_plugins/custom_plug_in_package.rst @@ -0,0 +1,90 @@ +.. _tutorials_others_custom_plug_ins_packages: + +======================================= +Plug-in package with multiple operators +======================================= + +This tutorial shows how to create, load and use a custom plug-in package with multiple operators or with complex routines + +Create the plug-in package +-------------------------- + +To create a plug-in package with multiple operators or with complex routines, you write a +Python package. The benefits of writing packages rather than simple scripts are: + +- **Componentization:** You can split the code into several Python modules or files. +- **Distribution:** You can use standard Python tools to upload and download packages. +- **Documentation:** You can add README files, documentation, tests, and examples to the package. + +A plug-in package with dependencies consists of a folder with the necessary files. Assume +that the name of your plug-in package is ``custom_plugin``. A folder with this name would +contain four files: + +- ``__init__.py`` +- ``operators.py`` +- ``operators_loader.py`` +- ``common.py`` + +**__init__.py file** + +The ``__init__.py`` file contains this code:: + + from operators_loader import load_operators + + +**operators.py file** + +The ``operators.py`` file contains code like this: + +.. literalinclude:: custom_operator_example.py + + +**operators_loader.py file** + +The ``operators_loader.py`` file contains code like this:: + + from custom_plugin import operators + from ansys.dpf.core.custom_operator import record_operator + + + def load_operators(*args): + record_operator(operators.CustomOperator, *args) + + +**common.py file** + +The ``common.py`` file contains the Python routines as classes and functions:: + + #write needed python routines as classes and functions here. + + +Load the plug-in package +------------------------ + +Use the :func:`load_library() ` method to load plug-in package. + +- The first argument is the path to the directory where the plug-in package is located. +- The second argument is ``py_`` where is the name identifying the plug-in package. +- The third argument is the name of the function exposed in the __init__ file for the plug-in package that is used to record operators. + +.. code:: + + dpf.load_library( + r"path/to/plugins/custom_plugin", + "py_my_custom_plugin", #if the load_operators function is defined in path/to/plugins/custom_plugin/__init__.py + "load_operators") + + +Use the custom operators +------------------------ + +Once the plugin is loaded, you can instantiate the custom operator: + +.. code:: + + new_operator = dpf.Operator("custom_operator") # if "custom_operator" is what is returned by the ``name`` property + +References +---------- +For more information, see :ref:`ref_custom_operator` in the **API reference** +and :ref:`python_operators` in **Examples**. \ No newline at end of file diff --git a/doc/source/user_guide/tutorials/custom_operators_and_plugins/custom_plug_in_package_third_deps.rst b/doc/source/user_guide/tutorials/custom_operators_and_plugins/custom_plug_in_package_third_deps.rst new file mode 100644 index 0000000000..5c16f72844 --- /dev/null +++ b/doc/source/user_guide/tutorials/custom_operators_and_plugins/custom_plug_in_package_third_deps.rst @@ -0,0 +1,158 @@ +.. _tutorials_others_custom_plug_ins_packages_third_deps: + +============================================= +Plug-in package with third-party dependencies +============================================= + +This tutorial shows how to create, load and use a custom plug-in package with third-party dependencies + +Create the plug-in package +-------------------------- + +To create a plug-in package with multiple operators or with complex routines, you write a +Python package. + +A plug-in package with dependencies consists of a folder with the necessary files. Assume +that the name of your plug-in package is ``custom_plugin``. A folder with this name would +contain four files: + +- ``__init__.py`` +- ``operators.py`` +- ``operators_loader.py`` +- ``common.py`` + +**__init__.py file** + +The ``__init__.py`` file contains this code:: + + from operators_loader import load_operators + + +**operators.py file** + +The ``operators.py`` file contains code like this: + +.. literalinclude:: custom_operator_example.py + + +**operators_loader.py file** + +The ``operators_loader.py`` file contains code like this:: + + from custom_plugin import operators + from ansys.dpf.core.custom_operator import record_operator + + + def load_operators(*args): + record_operator(operators.CustomOperator, *args) + + +**common.py file** + +The ``common.py`` file contains the Python routines as classes and functions:: + + #write needed python routines as classes and functions here. + + +Third-party dependencies +------------------------ + +.. include:: custom_operators_deps.rst + + +Assume once again that the name of your plug-in package is ``custom_plugin``. +A folder with this name would contain these files: + +- ``__init__.py`` +- ``operators.py`` +- ``operators_loader.py`` +- ``common.py`` +- ``winx64.zip`` +- ``linx64.zip`` +- ``custom_plugin.xml`` + +**__init__.py file** + +The ``__init__.py`` file contains this code:: + + from operators_loader import load_operators + + +**operators.py file** + +The ``operators.py`` file contains code like this: + +.. literalinclude:: custom_operator_example.py + + +**operators_loader.py file** + +The ``operators_loader.py`` file contains code like this:: + + from custom_plugin import operators + from ansys.dpf.core.custom_operator import record_operator + + + def load_operators(*args): + record_operator(operators.CustomOperator, *args) + + + def load_operators(*args): + record_operator(operators.CustomOperator, *args) + +**common.py file** + +The ``common.py`` file contains the Python routines as classes and functions:: + + #write needed python routines as classes and functions here. + + +**requirements.txt file** + +The ``requirements.txt`` file contains code like this: + +.. literalinclude:: /examples/07-python-operators/plugins/gltf_plugin/requirements.txt + +The ZIP files for Windows and Linux are included as assets: + +- ``winx64.zip`` +- ``linx64.zip`` + + +**custom_plugin.xml file** + +The ``custom_plugin.xml`` file contains code like this: + +.. literalinclude:: custom_plugin.xml + :language: xml + + +Load the plug-in package +------------------------ + +Use the :func:`load_library() ` method to load plug-in package. + +- The first argument is the path to the directory where the plug-in package is located. +- The second argument is ``py_`` where is the name identifying the plug-in package. +- The third argument is the name of the function exposed in the __init__ file for the plug-in package that is used to record operators. + +.. code:: + + dpf.load_library( + r"path/to/plugins/custom_plugin", + "py_my_custom_plugin", #if the load_operators function is defined in path/to/plugins/custom_plugin/__init__.py + "load_operators") + +Use the custom operators +-------------------- + +Once the plugin is loaded, you can instantiate the custom operator: + +.. code:: + + new_operator = dpf.Operator("custom_operator") # if "custom_operator" is what is returned by the ``name`` property + +References +---------- +For more information, see :ref:`ref_custom_operator` in the **API reference** +and :ref:`python_operators` in **Examples**. \ No newline at end of file diff --git a/doc/source/user_guide/custom_plugin.xml b/doc/source/user_guide/tutorials/custom_operators_and_plugins/custom_plugin.xml similarity index 100% rename from doc/source/user_guide/custom_plugin.xml rename to doc/source/user_guide/tutorials/custom_operators_and_plugins/custom_plugin.xml diff --git a/doc/source/user_guide/tutorials/custom_operators_and_plugins/index.rst b/doc/source/user_guide/tutorials/custom_operators_and_plugins/index.rst new file mode 100644 index 0000000000..45707f4c64 --- /dev/null +++ b/doc/source/user_guide/tutorials/custom_operators_and_plugins/index.rst @@ -0,0 +1,44 @@ +.. _ref_tutorials_custom_operators_and_plugins: + +Custom Operators and Plugins +---------------------------- +The available DPF capabilities loaded in a DPF application can be enhanced +by creating new operator’s libraries. DPF offers multiple development APIs +depending on your environment. + +These tutorials demonstrate how to develop those plugins for PyDPF-Core (CPython based) + +.. grid:: 1 1 3 3 + :gutter: 2 + :padding: 2 + :margin: 2 + + .. grid-item-card:: Create custom operators and plugins + :link: user_guide_custom_operators + :link-type: ref + :text-align: center + + This tutorial shows how to create, load and use a basic operator plugin, which is for a single custom operator + + .. grid-item-card:: Create a plug-in package with multiple operators + :link: tutorials_others_custom_plug_ins_packages + :link-type: ref + :text-align: center + + This tutorial shows how to create, load and use a custom plug-in package with multiple operators or with complex routines + + .. grid-item-card:: Create a plug-in package that has third-party dependencies + :link: tutorials_others_custom_plug_ins_packages_third_deps + :link-type: ref + :text-align: center + + This tutorial shows how to create a Python plug-in package with third-party dependencies + +.. toctree:: + :maxdepth: 2 + :hidden: + + custom_operators.rst + custom_plug_in_package.rst + custom_plug_in_package_third_deps.rst + diff --git a/doc/source/user_guide/install_ansys_dpf_core_in_ansys.ps1 b/doc/source/user_guide/tutorials/custom_operators_and_plugins/install_ansys_dpf_core_in_ansys.ps1 similarity index 100% rename from doc/source/user_guide/install_ansys_dpf_core_in_ansys.ps1 rename to doc/source/user_guide/tutorials/custom_operators_and_plugins/install_ansys_dpf_core_in_ansys.ps1 diff --git a/doc/source/user_guide/install_ansys_dpf_core_in_ansys.sh b/doc/source/user_guide/tutorials/custom_operators_and_plugins/install_ansys_dpf_core_in_ansys.sh similarity index 100% rename from doc/source/user_guide/install_ansys_dpf_core_in_ansys.sh rename to doc/source/user_guide/tutorials/custom_operators_and_plugins/install_ansys_dpf_core_in_ansys.sh diff --git a/doc/source/user_guide/uninstall_ansys_dpf_core_in_ansys.ps1 b/doc/source/user_guide/tutorials/custom_operators_and_plugins/uninstall_ansys_dpf_core_in_ansys.ps1 similarity index 100% rename from doc/source/user_guide/uninstall_ansys_dpf_core_in_ansys.ps1 rename to doc/source/user_guide/tutorials/custom_operators_and_plugins/uninstall_ansys_dpf_core_in_ansys.ps1 diff --git a/doc/source/user_guide/uninstall_ansys_dpf_core_in_ansys.sh b/doc/source/user_guide/tutorials/custom_operators_and_plugins/uninstall_ansys_dpf_core_in_ansys.sh similarity index 100% rename from doc/source/user_guide/uninstall_ansys_dpf_core_in_ansys.sh rename to doc/source/user_guide/tutorials/custom_operators_and_plugins/uninstall_ansys_dpf_core_in_ansys.sh diff --git a/doc/source/user_guide/tutorials/data_structures/index.rst b/doc/source/user_guide/tutorials/data_structures/index.rst new file mode 100644 index 0000000000..602efc732d --- /dev/null +++ b/doc/source/user_guide/tutorials/data_structures/index.rst @@ -0,0 +1,42 @@ +.. _ref_tutorials_data_structures: + +=================== +DPF data structures +=================== + +DPF uses two main data structures to handle data: Fields and Collections. +Therefore, it is important to be aware of how the data is +structured in those containers. + +The data containers can be: + + - **Raw data storage structures**: Data arrays (a ``Field`` for example) or Data Maps (a ``DataTree`` for example) + - **Collections**: a group of same labeled objects from one DPF raw data storage structure (a ``FieldsContainer`` for example, that is a group of ``Fields`` with the same label) + +These tutorials explains how these structures work and how you can manipulate data within. + +.. grid:: 1 1 3 3 + :gutter: 2 + :padding: 2 + :margin: 2 + + .. grid-item-card:: DPF raw data storage structures + :link: ref_tutorials + :link-type: ref + :text-align: center + + This tutorial shows how to create and work with some DPF data arrays: + Field, StringField and PropertyField + + + .. grid-item-card:: DPF collections + :link: ref_tutorials_language_and_usage + :link-type: ref + :text-align: center + + This tutorial shows how to create and work with some DPF collections: + FieldsContainer, MeshesContainer and ScopingContainer + +.. toctree:: + :maxdepth: 2 + :hidden: diff --git a/doc/source/user_guide/tutorials/distributed_files/index.rst b/doc/source/user_guide/tutorials/distributed_files/index.rst new file mode 100644 index 0000000000..70240e016d --- /dev/null +++ b/doc/source/user_guide/tutorials/distributed_files/index.rst @@ -0,0 +1,31 @@ +.. _ref_tutorials_distributed_files: + +============================== +Post-process distributed files +============================== + +These tutorials show how to create workflows on different processes (possibly on different machines) and connect them. + +.. grid:: 1 1 3 3 + :gutter: 2 + :padding: 2 + :margin: 2 + + .. grid-item-card:: Post process data on distributed processes + :link: ref_tutorials + :link-type: ref + :text-align: center + + This tutorial + + .. grid-item-card:: Create a custom workflow on distributed processes + :link: ref_tutorials + :link-type: ref + :text-align: center + + This tutorial + +.. toctree:: + :maxdepth: 2 + :hidden: + diff --git a/doc/source/user_guide/tutorials/dpf_server/index.rst b/doc/source/user_guide/tutorials/dpf_server/index.rst new file mode 100644 index 0000000000..efc4e1bfdb --- /dev/null +++ b/doc/source/user_guide/tutorials/dpf_server/index.rst @@ -0,0 +1,24 @@ +.. _ref_tutorials_dpf_server: + +========== +DPF server +========== + +This tutorial explains how to manipulate DPF client-server architecture + +.. grid:: 1 1 3 3 + :gutter: 2 + :padding: 2 + :margin: 2 + + .. grid-item-card:: Switch between local and remote server + :link: ref_tutorials + :link-type: ref + :text-align: center + + This tutorial + +.. toctree:: + :maxdepth: 2 + :hidden: + diff --git a/doc/source/user_guide/tutorials/export_data/index.rst b/doc/source/user_guide/tutorials/export_data/index.rst new file mode 100644 index 0000000000..c9be8ecd6c --- /dev/null +++ b/doc/source/user_guide/tutorials/export_data/index.rst @@ -0,0 +1,28 @@ +.. _ref_tutorials_export_data: + +=========== +Export data +=========== + +Data in DPF can be exported to universal file formats, such as VTK, HDF5, and TXT files. +You can use it to generate TH-plots, screenshots, and animations or to create custom result +plots using the `numpy `_ and `matplotlib `_ packages. + +These tutorials explains how to export data from your manipulations with PyDPF-Core. + +.. grid:: 1 1 3 3 + :gutter: 2 + :padding: 2 + :margin: 2 + + .. grid-item-card:: HDF5 export + :link: ref_tutorials + :link-type: ref + :text-align: center + + This tutorial + +.. toctree:: + :maxdepth: 2 + :hidden: + diff --git a/doc/source/user_guide/tutorials/import_data/index.rst b/doc/source/user_guide/tutorials/import_data/index.rst new file mode 100644 index 0000000000..112339d5a5 --- /dev/null +++ b/doc/source/user_guide/tutorials/import_data/index.rst @@ -0,0 +1,65 @@ +.. _ref_tutorials_import_data: + +=========== +Import Data +=========== + +These tutorials demonstrate how to represent data in DPF: either from manual input either +form simulation result files. + +From user input +*************** + +.. grid:: 1 1 3 3 + :gutter: 2 + :padding: 2 + :margin: 2 + + .. grid-item-card:: Import data from csv file + :link: ref_tutorials + :link-type: ref + :text-align: center + + Learn how to import data in DPF from csv file + + .. grid-item-card:: Represent your data in DPF + :link: ref_tutorials + :link-type: ref + :text-align: center + + Learn how to represent your manual input data in a DPF data storage structure + +From result files +***************** + +.. grid:: 1 1 3 3 + :gutter: 2 + :padding: 2 + :margin: 2 + + .. grid-item-card:: Extract and explore results metadata + :link: ref_tutorials + :link-type: ref + :text-align: center + + This tutorial + + .. grid-item-card:: Extract and explore results + :link: ref_tutorials + :link-type: ref + :text-align: center + + This tutorial + + .. grid-item-card:: Narrow down data (scoping tutorial) + :link: ref_tutorials + :link-type: ref + :text-align: center + + This tutorial + + +.. toctree:: + :maxdepth: 2 + :hidden: + diff --git a/doc/source/user_guide/tutorials/index.rst b/doc/source/user_guide/tutorials/index.rst new file mode 100644 index 0000000000..5ffe160db5 --- /dev/null +++ b/doc/source/user_guide/tutorials/index.rst @@ -0,0 +1,144 @@ +.. _ref_tutorials: + +Tutorials +--------- + +The tutorials cover specifics features with detailed demonstrations to help +understanding the fundamental PyDPF-Core functionalities and clarify some concepts. +They are designed to teach how to perform a task, providing explanations at each stage. + +It helps to have a Python interpreter for hands-on experience, but all code examples are +executed, so the tutorial can be read off-line as well. + +For a complete description of all the objects and modules, see the :ref:`API reference ` +section. + +:fa:`person-running` Beginner's guide +************************************* + +New to PyDPF-Core? Check our beginner's tutorials. They offer an overview +of our package background so you can understand how to work with it. + +.. grid:: 1 1 3 3 + :gutter: 2 + :padding: 2 + :margin: 2 + + .. grid-item-card:: PyDPF-Core data structures + :link: ref_tutorials_data_structures + :link-type: ref + :text-align: center + + Learn the different data structures used by DPF when handling data + + .. grid-item-card:: PyDPF-Core language + :link: ref_tutorials_language_and_usage + :link-type: ref + :text-align: center + + Check an overview on how to use PyDPF-Core API. + Learn the different ways to interact with data by using PyDPF-Core + objects and methods. + + .. grid-item-card:: Post-processing data basics + :link: ref_tutorials_processing_basics + :link-type: ref + :text-align: center + + Learn the basics on a post-processing procedure + using PyDPf-Core based on its usual main steps. The goal is to + transform simulation data into output data that can be used to + visualize and analyze simulation results. + +:fa:`book-open-reader` Features usage +************************************* + +.. grid:: 1 1 3 3 + :gutter: 2 + :padding: 2 + :margin: 2 + + .. grid-item-card:: Import Data on DPF + :link: ref_tutorials_import_data + :link-type: ref + :text-align: center + + Understand how to represent data in DPF: either from manual input either form result files. + + .. grid-item-card:: Mesh analysis + :link: ref_tutorials_mesh + :link-type: ref + :text-align: center + + Learn how to explore a mesh in DPF. + + .. grid-item-card:: Transform data with PyDPF-Core + :link: ref_tutorials_transform_data + :link-type: ref + :text-align: center + + Learn how to transform and operate on data to obtain the desired input. + + .. grid-item-card:: Export data from DPF + :link: ref_tutorials_export_data + :link-type: ref + :text-align: center + + Discover the best ways to export data from your manipulations with PyDPF-Core. + + .. grid-item-card:: Plot + :link: ref_tutorials_plot + :link-type: ref + :text-align: center + + Explore the different approaches to visualise the data in plots. + + .. grid-item-card:: Animate + :link: ref_tutorials_animate + :link-type: ref + :text-align: center + + Explore the different approaches to visualise the data in an animation. + + .. grid-item-card:: Custom Operators and Plugins + :link: ref_tutorials_custom_operators_and_plugins + :link-type: ref + :text-align: center + + Discover how to enhance DPF capabilities by creating new operator’s libraries. + + .. grid-item-card:: Post-process distributed files + :link: ref_tutorials_distributed_files + :link-type: ref + :text-align: center + + Learn how to use PyDPF-Core with distributed files. + + .. grid-item-card:: DPF server + :link: ref_tutorials_dpf_server + :link-type: ref + :text-align: center + + Understand how to manipulate DPF client-server architecture + + .. grid-item-card:: Licensing + :link: ref_tutorials_licensing + :link-type: ref + :text-align: center + + Understand how to access the Entry and Premium licensing capabilities + + .. grid-item-card:: Mathematical operations + :link: ref_tutorials_mathematics + :link-type: ref + :text-align: center + + Learn how to do mathematical operations using PyDPF-Core API and data structures + + .. grid-item-card:: Manipulating physics data + :link: ref_tutorials_mathematics + :link-type: ref + :text-align: center + + Learn how to manipulate the physics data associate to a + data storage structure. (Unit, homogeneity ...) \ No newline at end of file diff --git a/doc/source/user_guide/tutorials/language_and_usage/index.rst b/doc/source/user_guide/tutorials/language_and_usage/index.rst new file mode 100644 index 0000000000..d56d10a795 --- /dev/null +++ b/doc/source/user_guide/tutorials/language_and_usage/index.rst @@ -0,0 +1,10 @@ +.. _ref_tutorials_language_and_usage: + +============================= +PyDPF-Core language and usage +============================= + +This tutorials gives you an overview on how the PyDPF-Core API can be used +to interact with data. + +For more detailed information on each module and function, see :ref:`ref_api_section`. diff --git a/doc/source/user_guide/tutorials/licensing/index.rst b/doc/source/user_guide/tutorials/licensing/index.rst new file mode 100644 index 0000000000..e7760c435b --- /dev/null +++ b/doc/source/user_guide/tutorials/licensing/index.rst @@ -0,0 +1,25 @@ +.. _ref_tutorials_licensing: + +========= +Licensing +========= + +This tutorial explains the DPF server licensing logic. Here you +learn about the Entry and Premium licensing capabilities + +.. grid:: 1 1 3 3 + :gutter: 2 + :padding: 2 + :margin: 2 + + .. grid-item-card:: Access Entry and Premium Capabilities + :link: ref_tutorials + :link-type: ref + :text-align: center + + This tutorial + +.. toctree:: + :maxdepth: 2 + :hidden: + diff --git a/doc/source/user_guide/tutorials/manipulate_physics_data/index.rst b/doc/source/user_guide/tutorials/manipulate_physics_data/index.rst new file mode 100644 index 0000000000..31b4fd3665 --- /dev/null +++ b/doc/source/user_guide/tutorials/manipulate_physics_data/index.rst @@ -0,0 +1,24 @@ +.. _ref_tutorials_manipulate_physics_data: + +======================= +Manipulate Physics data +======================= + +This sections demonstrates how to manipulate the physics data associate to a +data storage structure. (Unit, homogeneity ...). + +.. grid:: 1 1 3 3 + :gutter: 2 + :padding: 2 + :margin: 2 + + .. grid-item-card:: Unit + :link: ref_tutorials + :link-type: ref + :text-align: center + + This tutorial + +.. toctree:: + :maxdepth: 2 + :hidden: diff --git a/doc/source/user_guide/tutorials/mathematics/index.rst b/doc/source/user_guide/tutorials/mathematics/index.rst new file mode 100644 index 0000000000..b4c251b086 --- /dev/null +++ b/doc/source/user_guide/tutorials/mathematics/index.rst @@ -0,0 +1,32 @@ +.. _ref_tutorials_mathematics: + +=========== +Mathematics +=========== + +DPF provides operators for implementing mathematical operations, ranging +from addition and multiplication to FFT and QR solving. + +This section explains how to you can do mathematical operations using +PyDPF-Core API and data structures. + +.. grid:: 1 1 3 3 + :gutter: 2 + :padding: 2 + :margin: 2 + + .. grid-item-card:: Basic maths + :link: ref_tutorials + :link-type: ref + :text-align: center + + This tutorial demonstrate how to do some basic + mathematical operations with PyDPF-Core. + +.. toctree:: + :maxdepth: 2 + :hidden: + + + + diff --git a/doc/source/user_guide/tutorials/mesh/index.rst b/doc/source/user_guide/tutorials/mesh/index.rst new file mode 100644 index 0000000000..8464839b40 --- /dev/null +++ b/doc/source/user_guide/tutorials/mesh/index.rst @@ -0,0 +1,61 @@ +.. _ref_tutorials_mesh: + +==== +Mesh +==== + +The mesh in DPF is represented by the :class:`MeshedRegion ` entity. + +These tutorials explains how to explore different attributes of a given mesh with PyDPF-Core. + + +.. grid:: 1 1 3 3 + :gutter: 2 + :padding: 2 + :margin: 2 + + .. grid-item-card:: Create a mesh from scratch + :link: ref_tutorials + :link-type: ref + :text-align: center + + This tutorial + + .. grid-item-card:: Get the mesh from a result file + :link: ref_tutorials + :link-type: ref + :text-align: center + + This tutorial + + .. grid-item-card:: Read the mesh metadata + :link: ref_tutorials + :link-type: ref + :text-align: center + + This tutorial + + .. grid-item-card:: Read the mesh + :link: ref_tutorials + :link-type: ref + :text-align: center + + This tutorial + + .. grid-item-card:: Read a subpart of the mesh + :link: ref_tutorials + :link-type: ref + :text-align: center + + This tutorial + + .. grid-item-card:: Split the mesh + :link: ref_tutorials + :link-type: ref + :text-align: center + + This tutorial + +.. toctree:: + :maxdepth: 2 + :hidden: diff --git a/doc/source/user_guide/tutorials/plot/index.rst b/doc/source/user_guide/tutorials/plot/index.rst new file mode 100644 index 0000000000..32f11495e5 --- /dev/null +++ b/doc/source/user_guide/tutorials/plot/index.rst @@ -0,0 +1,44 @@ +.. _ref_tutorials_plot: + +==== +Plot +==== + +These tutorials demonstrate some different approaches to visualise the data in plots. + +.. grid:: 1 1 3 3 + :gutter: 2 + :padding: 2 + :margin: 2 + + .. grid-item-card:: Plotting meshes + :link: ref_tutorials + :link-type: ref + :text-align: center + + This tutorial + + .. grid-item-card:: Plotting data on the mesh + :link: ref_tutorials + :link-type: ref + :text-align: center + + This tutorial + + .. grid-item-card:: Plotting data on specific placements + :link: ref_tutorials + :link-type: ref + :text-align: center + + This tutorial + + .. grid-item-card:: Plotting a graph + :link: ref_tutorials + :link-type: ref + :text-align: center + + This tutorial + +.. toctree:: + :maxdepth: 2 + :hidden: diff --git a/doc/source/user_guide/tutorials/post_processing_basics/01-main-steps.rst b/doc/source/user_guide/tutorials/post_processing_basics/01-main-steps.rst new file mode 100644 index 0000000000..43ef9b3a36 --- /dev/null +++ b/doc/source/user_guide/tutorials/post_processing_basics/01-main-steps.rst @@ -0,0 +1,199 @@ +.. _tutorials_main_steps: + +Postprocessing main steps +------------------------- + +There are five main steps to transform simulation data into output data that can +be used to visualize and analyze simulation results: + +.. grid:: + :gutter: 2 + :padding: 2 + :margin: 2 + + .. grid-item-card:: 1 + :link: tutorials_main_steps_1 + :link-type: ref + :text-align: center + + Importing and opening results files + + .. grid-item-card:: 2 + :link: tutorials_main_steps_2 + :link-type: ref + :text-align: center + + Access and extract results + + .. grid-item-card:: 3 + :link: tutorials_main_steps_3 + :link-type: ref + :text-align: center + + Transform available data + + .. grid-item-card:: 4 + :link: tutorials_main_steps_4 + :link-type: ref + :text-align: center + + Visualize the data + + .. grid-item-card:: 5 + :link: tutorials_main_steps_5 + :link-type: ref + :text-align: center + + Export data + +.. _tutorials_main_steps_1: + +1- Importing and opening results files +************************************** + +First, import the DPF-Core module as ``dpf`` and import the included examples file + +.. code-block:: python + + from ansys.dpf import core as dpf + from ansys.dpf.core import examples + from ansys.dpf.core import operators as ops + +`DataSources' is a class that manages paths to their files. Use this object to declare +data inputs for DPF and define their locations. + +.. code-block:: python + + # Define the DataSources object + my_data_sources = dpf.DataSources(result_path=examples.find_simple_bar()) + + +The model is a helper designed to give shortcuts to access the analysis results +metadata, by opening a DataSources or a Streams, and to instanciate results provider for it. + +Printing the model displays: + + - Analysis type + - Available results + - Size of the mesh + - Number of results + +.. code-block:: python + + # Define the Model object + my_model = dpf.Model(data_sources=my_data_sources) + print(my_model) + +.. rst-class:: sphx-glr-script-out + + .. jupyter-execute:: + :hide-code: + + from ansys.dpf import core as dpf + from ansys.dpf.core import examples + from ansys.dpf.core import operators as ops + my_data_sources = dpf.DataSources(result_path=examples.find_simple_bar()) + my_model = dpf.Model(data_sources=my_data_sources) + print(my_model) + +.. _tutorials_main_steps_2: + +2- Access and extract results +***************************** + +We see in the model that a displacement result is available. You can access this result by: + +.. code-block:: python + + # Define the displacement results through the models property `results` + my_displacements = my_model.results.displacement.eval() + print(my_displacements) + +.. rst-class:: sphx-glr-script-out + + .. jupyter-execute:: + :hide-code: + + my_displacements = my_model.results.displacement.eval() + print(my_displacements) + +The displacement data can be extract by: + +.. code-block:: python + + # Extract the data of the displacement field + my_displacements_0 = my_displacements[0].data + print(my_displacements_0) + +.. rst-class:: sphx-glr-script-out + + .. jupyter-execute:: + :hide-code: + + my_displacements_0 = my_displacements[0].data + print(my_displacements_0) + +.. _tutorials_main_steps_3: + +3- Transform available data +*************************** + +Several transformations can be made with the data. They can be a single operation, +by using only one operator, or they can represent a succession of operations, by defining a +workflow with chained operators. + +Here we star by computing the displacements norm. + +.. code-block:: python + + # Define the norm operator (here for a fields container) for the displacement + my_norm = ops.math.norm_fc(fields_container=my_displacements).eval() + print(my_norm[0].data) + +.. rst-class:: sphx-glr-script-out + + .. jupyter-execute:: + :hide-code: + + my_norm = ops.math.norm_fc(fields_container=my_displacements).eval() + print(my_norm[0].data) + +Then we compute the maximum values of the normalised displacement + +.. code-block:: python + + # Define the maximum operator and chain it to the norm operator + my_max= ops.min_max.min_max_fc(fields_container=my_norm).outputs.field_max() + print(my_max) + +.. rst-class:: sphx-glr-script-out + + .. jupyter-execute:: + :hide-code: + + my_max = ops.min_max.min_max_fc(fields_container=my_norm).outputs.field_max() + print(my_max) + +.. _tutorials_main_steps_4: + +4- Visualize the data +********************* + +Plot the transformed displacement results + +.. code-block:: python + + # Define the support of the plot (here we plot the displacement over the mesh) + my_model.metadata.meshed_region.plot(field_or_fields_container=my_displacements) + +.. rst-class:: sphx-glr-script-out + + .. jupyter-execute:: + :hide-code: + + my_model.metadata.meshed_region.plot(field_or_fields_container=my_displacements) + +.. _tutorials_main_steps_5: + +5- Extract the data +******************* \ No newline at end of file diff --git a/doc/source/user_guide/tutorials/post_processing_basics/index.rst b/doc/source/user_guide/tutorials/post_processing_basics/index.rst new file mode 100644 index 0000000000..b98cf33a34 --- /dev/null +++ b/doc/source/user_guide/tutorials/post_processing_basics/index.rst @@ -0,0 +1,14 @@ +.. _ref_tutorials_processing_basics: + +====================== +Processing data basics +====================== + +Data Processing consists in a series of operations applied to data to achieve a goal. DPF enables +you to access and transform simulation data using customizable workflows. + +There is an extensive catalog of operators with different kinds and complexity that can be used together. + +The tutorials in this section presents a basic application of PyDPF-Core as post-processing tool. + +.. include:: 01-main-steps.rst \ No newline at end of file diff --git a/doc/source/user_guide/tutorials/transform_data/index.rst b/doc/source/user_guide/tutorials/transform_data/index.rst new file mode 100644 index 0000000000..1af0c017fc --- /dev/null +++ b/doc/source/user_guide/tutorials/transform_data/index.rst @@ -0,0 +1,49 @@ +.. _ref_tutorials_transform_data: + +============== +Transform data +============== + +An operator is the main object that is used to create, transform, and stream data in DPF. + +They can perform different modifications with the data: direct mathematical operations, +averaging in the mesh, changes in the model locations .... They can also be chained together +to create more complex operations and customizable results. + +The tutorials in this section aims to explain how to transform and operate on data to obtain +the desired input by using the DPF operators with PyDPF-Core. + +For more information on how to program with PyDPF-Core check the +:ref:`ref_tutorials_language_and_usage` tutorial. + + +.. grid:: 1 1 3 3 + :gutter: 2 + :padding: 2 + :margin: 2 + + .. grid-item-card:: Using operators + :link: ref_tutorials + :link-type: ref + :text-align: center + + This tutorial + + .. grid-item-card:: Create a workflow + :link: ref_tutorials + :link-type: ref + :text-align: center + + This tutorial + + .. grid-item-card:: Mathematical operations with PyDPF-Core data storage structures + :link: ref_tutorials + :link-type: ref + :text-align: center + + This tutorial + +.. toctree:: + :maxdepth: 2 + :hidden: + diff --git a/examples/08-python-operators/02-python_operators_with_dependencies.py b/examples/08-python-operators/02-python_operators_with_dependencies.py index f88d9e4a80..c3ed5c272d 100644 --- a/examples/08-python-operators/02-python_operators_with_dependencies.py +++ b/examples/08-python-operators/02-python_operators_with_dependencies.py @@ -123,9 +123,9 @@ # Download the script for your operating system. # # - For Windows, download this -# :download:`PowerShell script `. +# :download:`PowerShell script `. # - For Linux, download this -# :download:`Shell script `. +# :download:`Shell script `. # # Run the downloaded script with the mandatory arguments: # @@ -157,6 +157,8 @@ "doc", "source", "user_guide", + "tutorials", + "custom_operators_and_plugins", "create_sites_for_python_operators.ps1", ) args = [ @@ -189,6 +191,8 @@ "doc", "source", "user_guide", + "tutorials", + "custom_operators_and_plugins", "create_sites_for_python_operators.sh", ) run_cmd = f"{cmd_file}" diff --git a/requirements/requirements_docs.txt b/requirements/requirements_docs.txt index 594ce0a0d6..eb300e023c 100644 --- a/requirements/requirements_docs.txt +++ b/requirements/requirements_docs.txt @@ -3,6 +3,7 @@ enum-tools[sphinx]==0.12.0 graphviz==0.20.1 imageio==2.36.0 imageio-ffmpeg==0.5.1 +jupyter_sphinx==0.5.3 nbsphinx==0.9.5 pypandoc==1.14 pytest-sphinx==0.6.3