From d2054666bbd956ba0d92a59fef49809e5db1033f Mon Sep 17 00:00:00 2001 From: Camille Date: Thu, 3 Nov 2022 14:06:58 +0100 Subject: [PATCH 01/10] Adding extra space --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d8f072f9175..02de8a19fec 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,6 +13,7 @@ repos: "--force-sort-within-sections", "--skip-glob", "*__init__.py", ] + - repo: https://gitlab.com/PyCQA/flake8 rev: 3.9.2 hooks: From fb2f6bf58801bbc91ce49fc1ec77d20a7325ef35 Mon Sep 17 00:00:00 2001 From: Camille Date: Mon, 7 Nov 2022 12:09:39 +0100 Subject: [PATCH 02/10] Building an example section --- .../contribution_and_api/building_example | 62 +++++++++++++++++++ doc/source/contribution_and_api/index.rst | 1 + pymapdl | 1 + 3 files changed, 64 insertions(+) create mode 100644 doc/source/contribution_and_api/building_example create mode 160000 pymapdl diff --git a/doc/source/contribution_and_api/building_example b/doc/source/contribution_and_api/building_example new file mode 100644 index 00000000000..5fc9873209a --- /dev/null +++ b/doc/source/contribution_and_api/building_example @@ -0,0 +1,62 @@ +.. _ref_example_building_api: + +Building an example +=================== + + +To run the documentation, you need to have the correct versions of each tools. To do so, execute the following instruction. + +.. code:: bash + + pip install -r requirements/requirements_docs.txt + + +The Sphinx configuration is in the file ``conf.py`` in ``doc/source``. + +To run the sphinx tool, : + +.. code:: bash + + doc\make.bat html + + + +There are three types of examples: the dynamic , the static and the semi-static ones. + + +Dynamic examples +---------------- + +They are based on python files and must be run under 3 minutes. + +They are in the ``examples`` directory in the repository. + +Example: https://github.com/pyansys/pymapdl/blob/main/examples/00-mapdl-examples/2d_plate_with_a_hole.py + +It is published on the following link: +`MAPDL 2D Plane Stress Concentration Analysis `_ + +They will be executed and the mention **Total running time of the script** will appear at the end of the document. + + +Static examples +--------------- + +They are based on RST files and will not be executed. + +They are in the ``doc\source`` directory. + +Example: https://raw.githubusercontent.com/pyansys/pymapdl/main/doc/source/examples/extended_examples/Krylov/krylov_example.rst + +It is published on the following link: `Harmonic analysis using the frequency-sweep Krylov method `_ + + +Semi-dynamic examples +--------------------- + +They are RST files which execute python code. + +Example: +https://raw.githubusercontent.com/pyansys/pymapdl/main/doc/source/examples/technology_showcase_examples/techdemo-28/ex_28-tecfricstir.rst + +It is visible at the following link: `Friction Stir Welding (FSW) Simulation `_ diff --git a/doc/source/contribution_and_api/index.rst b/doc/source/contribution_and_api/index.rst index fcd94f28cda..390fb178a42 100644 --- a/doc/source/contribution_and_api/index.rst +++ b/doc/source/contribution_and_api/index.rst @@ -123,6 +123,7 @@ MAPDL commands mapped to PyMAPDL, see :ref:`ref_mapdl_commands`. commands database + building_example geometry helper inline diff --git a/pymapdl b/pymapdl new file mode 160000 index 00000000000..3145975d7c6 --- /dev/null +++ b/pymapdl @@ -0,0 +1 @@ +Subproject commit 3145975d7c605331aa0e54dd22008ef875f55318 From 44764679127aa5ce9aa70e27a6832847ecd6e6fe Mon Sep 17 00:00:00 2001 From: clatapie <78221213+clatapie@users.noreply.github.com> Date: Mon, 7 Nov 2022 12:24:32 +0100 Subject: [PATCH 03/10] Update doc/source/contribution_and_api/building_example Co-authored-by: Roberto Pastor Muela --- doc/source/contribution_and_api/building_example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/contribution_and_api/building_example b/doc/source/contribution_and_api/building_example index 5fc9873209a..02bd3bb871a 100644 --- a/doc/source/contribution_and_api/building_example +++ b/doc/source/contribution_and_api/building_example @@ -21,7 +21,7 @@ To run the sphinx tool, : -There are three types of examples: the dynamic , the static and the semi-static ones. +There are three types of examples: dynamic, static, and semi-static. Dynamic examples From c02ab7c27ce8c8b0534c60b6e02550f2600fafc6 Mon Sep 17 00:00:00 2001 From: clatapie <78221213+clatapie@users.noreply.github.com> Date: Mon, 7 Nov 2022 12:26:05 +0100 Subject: [PATCH 04/10] Apply suggestions from code review Co-authored-by: Roberto Pastor Muela --- doc/source/contribution_and_api/building_example | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/source/contribution_and_api/building_example b/doc/source/contribution_and_api/building_example index 02bd3bb871a..2912cafdf1c 100644 --- a/doc/source/contribution_and_api/building_example +++ b/doc/source/contribution_and_api/building_example @@ -13,7 +13,7 @@ To run the documentation, you need to have the correct versions of each tools. T The Sphinx configuration is in the file ``conf.py`` in ``doc/source``. -To run the sphinx tool, : +To run the sphinx tool: .. code:: bash @@ -27,9 +27,9 @@ There are three types of examples: dynamic, static, and semi-static. Dynamic examples ---------------- -They are based on python files and must be run under 3 minutes. +They are based on Python files and must be run under 3 minutes. -They are in the ``examples`` directory in the repository. +They are in the ``examples`` directory inside this repository. Example: https://github.com/pyansys/pymapdl/blob/main/examples/00-mapdl-examples/2d_plate_with_a_hole.py @@ -54,7 +54,7 @@ It is published on the following link: `Harmonic analysis using the frequency-sw Semi-dynamic examples --------------------- -They are RST files which execute python code. +They are RST files which execute Python code. Example: https://raw.githubusercontent.com/pyansys/pymapdl/main/doc/source/examples/technology_showcase_examples/techdemo-28/ex_28-tecfricstir.rst From eda6a2d93c39474472b6809851aef6cdaeab5098 Mon Sep 17 00:00:00 2001 From: Camille Date: Mon, 7 Nov 2022 12:49:46 +0100 Subject: [PATCH 05/10] Delete pymapdl repo --- pymapdl | 1 - 1 file changed, 1 deletion(-) delete mode 160000 pymapdl diff --git a/pymapdl b/pymapdl deleted file mode 160000 index 3145975d7c6..00000000000 --- a/pymapdl +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3145975d7c605331aa0e54dd22008ef875f55318 From fb50f0b64ea055c38002c3b7f7a1fd3400b76412 Mon Sep 17 00:00:00 2001 From: Camille Date: Mon, 7 Nov 2022 14:04:00 +0100 Subject: [PATCH 06/10] Delete pre-commit space --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 02de8a19fec..9b3ab579bfd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: "--force-sort-within-sections", "--skip-glob", "*__init__.py", ] - + - repo: https://gitlab.com/PyCQA/flake8 rev: 3.9.2 hooks: From 30dd8fa11bac866dde98f31620628f1fc198d0fd Mon Sep 17 00:00:00 2001 From: Camille Date: Mon, 7 Nov 2022 14:20:39 +0100 Subject: [PATCH 07/10] Change into RST file --- .../{building_example => building_example.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/source/contribution_and_api/{building_example => building_example.rst} (100%) diff --git a/doc/source/contribution_and_api/building_example b/doc/source/contribution_and_api/building_example.rst similarity index 100% rename from doc/source/contribution_and_api/building_example rename to doc/source/contribution_and_api/building_example.rst From 1bde8accc2a9b152e6828a99fececf2060a6755b Mon Sep 17 00:00:00 2001 From: Camille Date: Tue, 8 Nov 2022 18:21:51 +0100 Subject: [PATCH 08/10] Adding recommendations --- .../contribution_and_api/building_example.rst | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/doc/source/contribution_and_api/building_example.rst b/doc/source/contribution_and_api/building_example.rst index 2912cafdf1c..ca5a31878ef 100644 --- a/doc/source/contribution_and_api/building_example.rst +++ b/doc/source/contribution_and_api/building_example.rst @@ -1,10 +1,14 @@ -.. _ref_example_building_api: +.. _ref_building_example: + +=================== Building an example =================== +.. currentmodule:: ansys.mapdl.core.building_example -To run the documentation, you need to have the correct versions of each tools. To do so, execute the following instruction. +To run the documentation, you need to have the correct versions of each tools. To do so, execute the +following instruction. .. code:: bash @@ -31,12 +35,13 @@ They are based on Python files and must be run under 3 minutes. They are in the ``examples`` directory inside this repository. -Example: https://github.com/pyansys/pymapdl/blob/main/examples/00-mapdl-examples/2d_plate_with_a_hole.py +Example: `2d_plate_with_a_hole.py `_ It is published on the following link: `MAPDL 2D Plane Stress Concentration Analysis `_ -They will be executed and the mention **Total running time of the script** will appear at the end of the document. +They will be executed and the mention **Total running time of the script** will appear at the end of +the document. Static examples @@ -46,7 +51,7 @@ They are based on RST files and will not be executed. They are in the ``doc\source`` directory. -Example: https://raw.githubusercontent.com/pyansys/pymapdl/main/doc/source/examples/extended_examples/Krylov/krylov_example.rst +Example: `krylov_example.rst `_ It is published on the following link: `Harmonic analysis using the frequency-sweep Krylov method `_ @@ -54,9 +59,22 @@ It is published on the following link: `Harmonic analysis using the frequency-sw Semi-dynamic examples --------------------- -They are RST files which execute Python code. +They are RST files which execute Python code using this RST directive: + +.. code:: bash + + .. jupyter-execute:: + :hide-code: -Example: -https://raw.githubusercontent.com/pyansys/pymapdl/main/doc/source/examples/technology_showcase_examples/techdemo-28/ex_28-tecfricstir.rst + +Example: `tecfricstir.rst `_ It is visible at the following link: `Friction Stir Welding (FSW) Simulation `_ + + +Recommendations +--------------- + +As the dynamic examples are examples that have to be run at each Documentation building, make sure to +make them very short. To get around the problem of execution time, feel free to use the static or the +semi-static examples. \ No newline at end of file From f7cfea1c9790ee36e0dd6ccf0332a3570ab48952 Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela Date: Thu, 10 Nov 2022 08:26:01 +0100 Subject: [PATCH 09/10] Update doc/source/contribution_and_api/building_example.rst --- doc/source/contribution_and_api/building_example.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/contribution_and_api/building_example.rst b/doc/source/contribution_and_api/building_example.rst index ca5a31878ef..24bc06744ce 100644 --- a/doc/source/contribution_and_api/building_example.rst +++ b/doc/source/contribution_and_api/building_example.rst @@ -75,6 +75,6 @@ It is visible at the following link: `Friction Stir Welding (FSW) Simulation Date: Fri, 11 Nov 2022 11:17:11 +0100 Subject: [PATCH 10/10] Update doc/source/contribution_and_api/building_example.rst --- doc/source/contribution_and_api/building_example.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/contribution_and_api/building_example.rst b/doc/source/contribution_and_api/building_example.rst index 24bc06744ce..78bab77f20b 100644 --- a/doc/source/contribution_and_api/building_example.rst +++ b/doc/source/contribution_and_api/building_example.rst @@ -7,7 +7,7 @@ Building an example .. currentmodule:: ansys.mapdl.core.building_example -To run the documentation, you need to have the correct versions of each tools. To do so, execute the +To run the documentation, you need to have the correct versions of each tool. To do so, execute the following instruction. .. code:: bash