Skip to content

Commit

Permalink
Fix documentation (#2848)
Browse files Browse the repository at this point in the history
* Fixing cli examples

* Fixing python supported versions

* Adding pymapdl

* Update doc/source/user_guide/cli.rst

Co-authored-by: Kathy Pippert <[email protected]>

* Update doc/source/user_guide/cli.rst

---------

Co-authored-by: Kathy Pippert <[email protected]>
  • Loading branch information
germa89 and PipKat authored Mar 4, 2024
1 parent 0134c23 commit 39ebb24
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 41 deletions.
6 changes: 3 additions & 3 deletions doc/source/getting_started/install_pymapdl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ 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 <pymapdl_pypi_>`_ with:
Install the latest release from `PyPi <pymapdl_pypi_>`_ with this command:

.. code:: console
Expand Down
111 changes: 74 additions & 37 deletions doc/source/user_guide/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ 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
:sync: key1

.. 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
Expand All @@ -44,22 +44,22 @@ 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
:sync: key1

.. 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
: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:
For instance, you could specify the working directory:

.. tab-set::

Expand All @@ -68,26 +68,24 @@ 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
:sync: key1

.. 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`
For more information, see :func:`ansys.mapdl.core.launcher.launch_mapdl`.


Stop MAPDL instances
====================
MAPDL instances can be stopped by using `launch_mapdl stop` command in the following
way:
You can use the ``pymapdl stop`` command to stop MAPDL instances like this:


.. tab-set::
Expand All @@ -97,15 +95,15 @@ 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
:sync: key1

.. code:: console
(.venv) user@machine:~$ launch_mapdl stop
(.venv) user@machine:~$ pymapdl stop
Success: Ansys instances running on port 50052 have been stopped.
Expand All @@ -121,15 +119,15 @@ 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
:sync: key1

.. 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.
Expand All @@ -143,16 +141,16 @@ 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
:sync: key1

.. code:: console
(.venv) user@machine:~$ launch_mapdl stop --pid 40952
Success: The process with PID 40952 and its children have been stopped.
(.venv) user@machine:~$ pymapdl stop --pid 40952
Success: The process with PID 40952 and its children has been stopped.
Alternatively, you can stop all the running instances by using:
Expand All @@ -165,15 +163,15 @@ 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
:sync: key1

.. code:: console
(.venv) user@machine:~$ launch_mapdl stop --all
(.venv) user@machine:~$ pymapdl stop --all
Success: Ansys instances have been stopped.
Expand All @@ -191,7 +189,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
Expand All @@ -203,7 +201,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
Expand All @@ -222,7 +220,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
Expand All @@ -232,7 +230,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
Expand All @@ -251,7 +249,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
Expand All @@ -263,7 +261,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
Expand All @@ -286,25 +284,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

.. code:: pwsh-session
(.venv) PS C:\Users\user\pymapdl> pymapdl convert mapdl.dat -o python.py
The ``mapdl.dat`` file is successfully converted to the ``python.py`` file.
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
Expand Down
2 changes: 1 addition & 1 deletion doc/source/user_guide/upf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions doc/styles/Vocab/ANSYS/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ PyAnsys Math
PyDPF-Core
PyDPF-Post
PyMAPDL
pymapdl
Python
QRDAMP
Radiosity
Expand Down

0 comments on commit 39ebb24

Please sign in to comment.