From f022fe34055f18eb853e50db36e22ad061c8b320 Mon Sep 17 00:00:00 2001 From: German Date: Mon, 4 Mar 2024 12:05:56 +0100 Subject: [PATCH 1/7] Fixing cli examples --- doc/source/user_guide/cli.rst | 105 +++++++++++++++++++++++----------- 1 file changed, 72 insertions(+), 33 deletions(-) diff --git a/doc/source/user_guide/cli.rst b/doc/source/user_guide/cli.rst index 83b63a683a..0877c773e2 100644 --- a/doc/source/user_guide/cli.rst +++ b/doc/source/user_guide/cli.rst @@ -22,7 +22,7 @@ To start MAPDL, just type on your activated virtual environment: .. code:: pwsh-session - (.venv) PS C:\Users\user\pymapdl> launch_mapdl + (.venv) PS C:\Users\user\pymapdl> pymapdl start Success: Launched an MAPDL instance (PID=23644) at 127.0.0.1:50052 .. tab-item:: Linux @@ -30,7 +30,7 @@ To start MAPDL, just type on your activated virtual environment: .. code:: console - (.venv) user@machine:~$ launch_mapdl + (.venv) user@machine:~$ pymapdl start Success: Launched an MAPDL instance (PID=23644) at 127.0.0.1:50052 If you want to specify an argument, for instance the port, then you need to call @@ -44,7 +44,7 @@ If you want to specify an argument, for instance the port, then you need to call .. code:: pwsh-session - (.venv) PS C:\Users\user\pymapdl> launch_mapdl start --port 50054 + (.venv) PS C:\Users\user\pymapdl> pymapdl start --port 50054 Success: Launched an MAPDL instance (PID=18238) at 127.0.0.1:50054 .. tab-item:: Linux @@ -52,14 +52,14 @@ If you want to specify an argument, for instance the port, then you need to call .. code:: console - (.venv) user@machine:~$ launch_mapdl start --port 50054 + (.venv) user@machine:~$ pymapdl start --port 50054 Success: Launched an MAPDL instance (PID=18238) at 127.0.0.1:50054 -This command `launch_mapdl start` aims to replicate the function +This command `pymapdl start` aims to replicate the function :func:`ansys.mapdl.core.launcher.launch_mapdl`, hence you can use some of the arguments which this function allows. -For instance, you could specify the working directory: +For instance, you could specify the working directory: .. tab-set:: @@ -68,7 +68,7 @@ For instance, you could specify the working directory: .. code:: pwsh-session - (.venv) PS C:\Users\user\pymapdl> launch_mapdl start --run_location C:\Users\user\temp\ + (.venv) PS C:\Users\user\pymapdl> pymapdl start --run_location C:\Users\user\temp\ Success: Launched an MAPDL instance (PID=32612) at 127.0.0.1:50052 .. tab-item:: Linux @@ -76,17 +76,17 @@ For instance, you could specify the working directory: .. code:: console - (.venv) user@machine:~$ launch_mapdl start --run_location /home/user/tmp + (.venv) user@machine:~$ pymapdl start --run_location /home/user/tmp Success: Launched an MAPDL instance (PID=32612) at 127.0.0.1:50052 For more information see :func:`ansys.mapdl.core.launcher.launch_mapdl`, -and :func:`ansys.mapdl.core.cli.launch_mapdl` +and :func:`ansys.mapdl.core.cli.pymapdl` Stop MAPDL instances ==================== -MAPDL instances can be stopped by using `launch_mapdl stop` command in the following +MAPDL instances can be stopped by using `pymapdl stop` command in the following way: @@ -97,7 +97,7 @@ way: .. code:: pwsh-session - (.venv) PS C:\Users\user\pymapdl> launch_mapdl stop + (.venv) PS C:\Users\user\pymapdl> pymapdl stop Success: Ansys instances running on port 50052 have been stopped. .. tab-item:: Linux @@ -105,7 +105,7 @@ way: .. code:: console - (.venv) user@machine:~$ launch_mapdl stop + (.venv) user@machine:~$ pymapdl stop Success: Ansys instances running on port 50052 have been stopped. @@ -121,7 +121,7 @@ You can specify the instance running on a different port using `--port` argument .. code:: pwsh-session - (.venv) PS C:\Users\user\pymapdl> launch_mapdl stop --port 50053 + (.venv) PS C:\Users\user\pymapdl> pymapdl stop --port 50053 Success: Ansys instances running on port 50053 have been stopped. .. tab-item:: Linux @@ -129,7 +129,7 @@ You can specify the instance running on a different port using `--port` argument .. code:: console - (.venv) user@machine:~$ launch_mapdl stop --port 50053 + (.venv) user@machine:~$ pymapdl stop --port 50053 Success: Ansys instances running on port 50053 have been stopped. @@ -143,7 +143,7 @@ Or an instance with a given process id (PID): .. code:: pwsh-session - (.venv) PS C:\Users\user\pymapdl> launch_mapdl stop --pid 40952 + (.venv) PS C:\Users\user\pymapdl> pymapdl stop --pid 40952 Success: The process with PID 40952 and its children have been stopped. .. tab-item:: Linux @@ -151,7 +151,7 @@ Or an instance with a given process id (PID): .. code:: console - (.venv) user@machine:~$ launch_mapdl stop --pid 40952 + (.venv) user@machine:~$ pymapdl stop --pid 40952 Success: The process with PID 40952 and its children have been stopped. @@ -165,7 +165,7 @@ Alternatively, you can stop all the running instances by using: .. code:: pwsh-session - (.venv) PS C:\Users\user\pymapdl> launch_mapdl stop --all + (.venv) PS C:\Users\user\pymapdl> pymapdl stop --all Success: Ansys instances have been stopped. .. tab-item:: Linux @@ -173,7 +173,7 @@ Alternatively, you can stop all the running instances by using: .. code:: console - (.venv) user@machine:~$ launch_mapdl stop --all + (.venv) user@machine:~$ pymapdl stop --all Success: Ansys instances have been stopped. @@ -191,7 +191,7 @@ If you want to list MAPDL process, just use the following command: .. code:: pwsh-session - (.venv) PS C:\Users\user\pymapdl> launch_mapdl list + (.venv) PS C:\Users\user\pymapdl> pymapdl list Name Is Instance Status gRPC port PID ------------ ------------- -------- ----------- ----- ANSYS.exe False running 50052 35360 @@ -203,7 +203,7 @@ If you want to list MAPDL process, just use the following command: .. code:: console - (.venv) user@machine:~$ launch_mapdl list + (.venv) user@machine:~$ pymapdl list Name Is Instance Status gRPC port PID ------------ ------------- -------- ----------- ----- ANSYS.exe False running 50052 35360 @@ -222,7 +222,7 @@ processes), just type: .. code:: pwsh-session - (.venv) PS C:\Users\user\pymapdl> launch_mapdl list -i + (.venv) PS C:\Users\user\pymapdl> pymapdl list -i Name Status gRPC port PID ------------ -------- ----------- ----- ANSYS222.exe running 50052 41644 @@ -232,7 +232,7 @@ processes), just type: .. code:: console - (.venv) user@machine:~$ launch_mapdl list -i + (.venv) user@machine:~$ pymapdl list -i Name Status gRPC port PID ------------ -------- ----------- ----- ANSYS222.exe running 50052 41644 @@ -251,7 +251,7 @@ argument `--long` or `-l`: .. code:: pwsh-session - (.venv) PS C:\Users\user\pymapdl> launch_mapdl list -l + (.venv) PS C:\Users\user\pymapdl> pymapdl list -l Name Is Instance Status gRPC port PID Command line Working directory ------------ ------------- -------- ----------- ----- -------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------- ANSYS.exe False running 50052 35360 C:\Program Files\ANSYS Inc\v222\ANSYS\bin\winx64\ANSYS.EXE -j file -b -i .__tmp__.inp -o .__tmp__.out -port 50052 -grpc C:\Users\User\AppData\Local\Temp\ansys_ahmfaliakp @@ -263,7 +263,7 @@ argument `--long` or `-l`: .. code:: console - (.venv) user@machine:~$ launch_mapdl list -l + (.venv) user@machine:~$ pymapdl list -l Name Is Instance Status gRPC port PID Command line Working directory ------------ ------------- -------- ----------- ----- ------------------------------------------------------------------------- -------------------------------- ANSYS False running 50052 35360 /ansys_inc/v222/ansys/bin/linx64/ansys -j file -port 50052 -grpc /home/user/temp/ansys_ahmfaliakp @@ -286,25 +286,64 @@ After you have activated and installed the package as described in :ref:`installation`, you can use the converter from your terminal. Here is how you use the ``pymapdl convert`` command: -.. code:: console - $ pymapdl convert mapdl.dat -o python.py +.. tab-set:: + + .. tab-item:: Windows + :sync: key1 - File mapdl.dat successfully converted to python.py. + .. code:: pwsh-session + + (.venv) PS C:\Users\user\pymapdl> pymapdl convert mapdl.dat -o python.py + + File mapdl.dat successfully converted to python.py. + + + .. tab-item:: Linux + :sync: key1 + + .. code:: console + + (.venv) user@machine:~$ pymapdl convert mapdl.dat -o python.py + + File mapdl.dat successfully converted to python.py. To obtain help on converter usage, options, and examples, type this command: -.. code:: console - $ pymapdl convert --help +.. tab-set:: + + .. tab-item:: Windows + :sync: key1 + + .. code:: pwsh-session + + (.venv) PS C:\Users\user\pymapdl> pymapdl convert --help + + + Usage: pymapdl convert [OPTIONS] FILENAME_IN + + PyMAPDL CLI tool for converting MAPDL scripts to PyMAPDL scripts. + + USAGE: + + ... + + + .. tab-item:: Linux + :sync: key1 + + .. code:: console - Usage: pymapdl convert [OPTIONS] FILENAME_IN + (.venv) user@machine:~$ pymapdl convert --help + + Usage: pymapdl convert [OPTIONS] FILENAME_IN - PyMAPDL CLI tool for converting MAPDL scripts to PyMAPDL scripts. + PyMAPDL CLI tool for converting MAPDL scripts to PyMAPDL scripts. - USAGE: + USAGE: - ... + ... The ``pymapdl convert`` command uses the From 2402054e33cefee4380b744157c279eb70a0558e Mon Sep 17 00:00:00 2001 From: German Date: Mon, 4 Mar 2024 12:06:13 +0100 Subject: [PATCH 2/7] Fixing python supported versions --- doc/source/getting_started/install_pymapdl.rst | 4 ++-- doc/source/user_guide/upf.rst | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/source/getting_started/install_pymapdl.rst b/doc/source/getting_started/install_pymapdl.rst index d0b6034e55..bdb599b8d3 100644 --- a/doc/source/getting_started/install_pymapdl.rst +++ b/doc/source/getting_started/install_pymapdl.rst @@ -8,8 +8,8 @@ Install PyMAPDL Python module ~~~~~~~~~~~~~ -The ``ansys.mapdl.core`` package currently supports Python 3.8 through -Python 3.11 on Windows, Mac OS, and Linux. +The ``ansys.mapdl.core`` package currently supports Python 3.9 through +Python 3.12 on Windows, Mac OS, and Linux. Install the latest release from `PyPi `_ with: diff --git a/doc/source/user_guide/upf.rst b/doc/source/user_guide/upf.rst index 57a4c9ebe6..86955d0a6a 100644 --- a/doc/source/user_guide/upf.rst +++ b/doc/source/user_guide/upf.rst @@ -9,7 +9,7 @@ Python language to code user programmable subroutines. A subset of the documented UPF subroutines support the Python UPF capability. For more information, see `Supported UPF subroutines`_). -You must install a Python distribution before using this feature. Python 3.8 +You must install a Python distribution before using this feature. Python 3.9 through Python 3.12 are supported. Python UPFs are only supported on Linux. From 20975bd031253a97d5412ea7dc3b33917d4dc39d Mon Sep 17 00:00:00 2001 From: German Date: Mon, 4 Mar 2024 12:51:30 +0100 Subject: [PATCH 3/7] Adding pymapdl --- doc/styles/Vocab/ANSYS/accept.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/styles/Vocab/ANSYS/accept.txt b/doc/styles/Vocab/ANSYS/accept.txt index dd6329b7d1..60889c20a4 100644 --- a/doc/styles/Vocab/ANSYS/accept.txt +++ b/doc/styles/Vocab/ANSYS/accept.txt @@ -129,6 +129,7 @@ PyAnsys Math PyDPF-Core PyDPF-Post PyMAPDL +pymapdl Python QRDAMP Radiosity From 19041677c528fdad54bf3b7c8f2f7ef23cd5f32f Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Mon, 4 Mar 2024 17:04:38 +0100 Subject: [PATCH 4/7] Update doc/source/user_guide/cli.rst Co-authored-by: Kathy Pippert <84872299+PipKat@users.noreply.github.com> --- doc/source/user_guide/cli.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/source/user_guide/cli.rst b/doc/source/user_guide/cli.rst index 0877c773e2..9a4ab4edc7 100644 --- a/doc/source/user_guide/cli.rst +++ b/doc/source/user_guide/cli.rst @@ -86,8 +86,7 @@ and :func:`ansys.mapdl.core.cli.pymapdl` Stop MAPDL instances ==================== -MAPDL instances can be stopped by using `pymapdl stop` command in the following -way: +You can use the ``pymapdl stop`` command to stop MAPDL instances like this: .. tab-set:: From ee9ac8246c4b9c052878928a845ff5d14129cb76 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Mon, 4 Mar 2024 17:06:08 +0100 Subject: [PATCH 5/7] Update doc/source/user_guide/cli.rst --- doc/source/user_guide/cli.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/user_guide/cli.rst b/doc/source/user_guide/cli.rst index 9a4ab4edc7..d7914fd7f1 100644 --- a/doc/source/user_guide/cli.rst +++ b/doc/source/user_guide/cli.rst @@ -56,7 +56,7 @@ If you want to specify an argument, for instance the port, then you need to call Success: Launched an MAPDL instance (PID=18238) at 127.0.0.1:50054 -This command `pymapdl start` aims to replicate the function +This command ``pymapdl start`` aims to replicate the function :func:`ansys.mapdl.core.launcher.launch_mapdl`, hence you can use some of the arguments which this function allows. For instance, you could specify the working directory: From ff6d4ae0eb1d7f298b41d9d894a323a87bdd1a21 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Mon, 4 Mar 2024 18:50:06 +0100 Subject: [PATCH 6/7] Apply suggestions from code review Co-authored-by: Kathy Pippert <84872299+PipKat@users.noreply.github.com> --- doc/source/getting_started/install_pymapdl.rst | 2 +- doc/source/user_guide/cli.rst | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/source/getting_started/install_pymapdl.rst b/doc/source/getting_started/install_pymapdl.rst index bdb599b8d3..baa49d5e25 100644 --- a/doc/source/getting_started/install_pymapdl.rst +++ b/doc/source/getting_started/install_pymapdl.rst @@ -11,7 +11,7 @@ Python module The ``ansys.mapdl.core`` package currently supports Python 3.9 through Python 3.12 on Windows, Mac OS, and Linux. -Install the latest release from `PyPi `_ with: +Install the latest release from `PyPi `_ with this command: .. code:: console diff --git a/doc/source/user_guide/cli.rst b/doc/source/user_guide/cli.rst index d7914fd7f1..38cdc18c55 100644 --- a/doc/source/user_guide/cli.rst +++ b/doc/source/user_guide/cli.rst @@ -56,8 +56,8 @@ If you want to specify an argument, for instance the port, then you need to call Success: Launched an MAPDL instance (PID=18238) at 127.0.0.1:50054 -This command ``pymapdl start`` aims to replicate the function -:func:`ansys.mapdl.core.launcher.launch_mapdl`, hence you can use +This ``pymapdl start`` command aims to replicate the function +:func:`ansys.mapdl.core.launcher.launch_mapdl`. Hence, you can use some of the arguments which this function allows. For instance, you could specify the working directory: @@ -80,8 +80,8 @@ For instance, you could specify the working directory: Success: Launched an MAPDL instance (PID=32612) at 127.0.0.1:50052 -For more information see :func:`ansys.mapdl.core.launcher.launch_mapdl`, -and :func:`ansys.mapdl.core.cli.pymapdl` +For more information, see :func:`ansys.mapdl.core.launcher.launch_mapdl`, +and :func:`ansys.mapdl.core.cli.pymapdl`. Stop MAPDL instances @@ -151,7 +151,7 @@ Or an instance with a given process id (PID): .. code:: console (.venv) user@machine:~$ pymapdl stop --pid 40952 - Success: The process with PID 40952 and its children have been stopped. + Success: The process with PID 40952 and its children has been stopped. Alternatively, you can stop all the running instances by using: @@ -295,7 +295,7 @@ Here is how you use the ``pymapdl convert`` command: (.venv) PS C:\Users\user\pymapdl> pymapdl convert mapdl.dat -o python.py - File mapdl.dat successfully converted to python.py. + The ``mapdl.dat`` file is successfully converted to the ``python.py`` file. .. tab-item:: Linux From 312ee800834e7958c7ee4668bc2fab9b16a590fb Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Mon, 4 Mar 2024 18:50:45 +0100 Subject: [PATCH 7/7] Update doc/source/user_guide/cli.rst --- doc/source/user_guide/cli.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/source/user_guide/cli.rst b/doc/source/user_guide/cli.rst index 38cdc18c55..f780f3b959 100644 --- a/doc/source/user_guide/cli.rst +++ b/doc/source/user_guide/cli.rst @@ -80,8 +80,7 @@ For instance, you could specify the working directory: Success: Launched an MAPDL instance (PID=32612) at 127.0.0.1:50052 -For more information, see :func:`ansys.mapdl.core.launcher.launch_mapdl`, -and :func:`ansys.mapdl.core.cli.pymapdl`. +For more information, see :func:`ansys.mapdl.core.launcher.launch_mapdl`. Stop MAPDL instances