Skip to content

Commit

Permalink
Fixing vale warning (#2394)
Browse files Browse the repository at this point in the history
* fix: vale warning

* Apply suggestions from code review

* fix: `troubleshoot.rst`

* fix: .vale

* test: adding code and tt in `SkippedScopes`

* fix: vale checks

* fix: moving .vale.ini

* maint: affing `vale-config` path

* maint: removing skip

* maint: fixing .vale.ini

* maint: reverting changes with `.vale.ini` location

* fix: `StylesPath` in `.vale.ini`

* fix: vale configuration to ignore `class` and `func`

* fix: `.vale.ini`

* fix: adding :attr: in TokenIgnores

* fix: adding `:meth:` in TokenIgnores

* fix: vale warnings

* fix: applying Revathy's review

* fix: vale check

* fic: ignoring vale for links

* fix: `.vale.ini`

* fix: `.vale.ini` configuration

* fix: applying Revathy's review

* fic: `.vale.ini` configuration

* doc: applying fixes from vale warnings

* Update doc/.vale.ini

Co-authored-by: Revathy Venugopal <[email protected]>

* doc: fixes references and formatting

* maint: updating cicd

* fix: adding ref in `troubleshoots.rst`

* fix: reverting changes from `.vale.ini`

* fix: updating `TokenIgnores`

* fix: adding `py` in `TokenIgnores`

* maint: removing [Mm]apdl as accepted words

* fix: skipping code sections

* Update doc/source/user_guide/mapdl.rst

---------

Co-authored-by: Revathy Venugopal <[email protected]>
  • Loading branch information
clatapie and Revathyvenugopal162 authored Oct 17, 2023
1 parent d0cbd6e commit 32743f0
Show file tree
Hide file tree
Showing 15 changed files with 106 additions and 111 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ jobs:
doc-style:
name: "Documentation style check"
runs-on: ubuntu-latest
#Skipping until 2394 is fixed
if: github.ref == 'Skip for now'
steps:
- name: "Ansys documentation style checks"
uses: ansys/actions/doc-style@v4
Expand Down Expand Up @@ -101,7 +99,7 @@ jobs:
docs-build:
name: "Build documentation"
runs-on: ubuntu-latest
# needs: doc-style - Skip for now
needs: doc-style
timeout-minutes: 60
outputs:
PYMAPDL_VERSION: ${{ steps.version.outputs.PYMAPDL_VERSION }}
Expand Down
2 changes: 2 additions & 0 deletions doc/.vale.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ Vocab = ANSYS
# Apply the following styles
BasedOnStyles = Vale, Google

TokenIgnores = (:(func|class|meth|attr|py):`(?:.|\n)*?`)|(<.*>)|(.. code::.*\n| .*)

# Removing Google-specific rule - Not applicable under some circumstances
Google.Colons = NO
10 changes: 5 additions & 5 deletions doc/source/api/unit_testing.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.. _ref_unit_testing_contributing:

Unit Testing
Unit testing
============

Unit tests validate the software by testing that the logic
implemented inside a certain method, class, or module is
working as expected. They should be as atomic and
independent as possible.

Unit testing is highly important. The tests check that code
Unit testing is highly important. The tests verify that code
changes are consistent with other parts of the code
and verify that these changes are implemented properly.

Expand All @@ -34,7 +34,7 @@ Coverage example
To show how the coverage works, assume that you have
this library:

**My awesome library**
**Awesome library**


.. code:: python
Expand Down Expand Up @@ -87,8 +87,8 @@ Continuous Integration and Continuous Deployment (CI/CD) approach

Unit tests and integration tests are part of Continuous Integration (CI).
The automation of testing, monitoring, and deployment of newly added
code allows Continuous Deployment (CD) throughout the application
lifecycle, providing a comprehensive CI/CD approach.
code allows Continuous Deployment (CD) throughout the app lifecycle,
providing a comprehensive CI/CD approach.

.. figure:: ../images/cicd.jpg
:width: 300pt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ open source Python meshing library. For more information, visit the Gmsh website

Description
-----------
Gmsh is used to import an external geometry file in STL format. The `pymapdl-reader <legacy_reader_docs_>`_ library
is then used to import the geometry into PyMAPDL.
Gmsh is used to import an external geometry file in STL format. The `PyMAPDL Reader <legacy_reader_docs_>`_
library is then used to import the geometry into PyMAPDL.

This example makes use of these files:

Expand Down
4 changes: 3 additions & 1 deletion doc/source/examples/extended_examples/gui/executable.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ The **Preprocessing** tab contains input fields for Poisson's ratio, Young modul
Add a PyVista plotting frame in the window
==========================================

Start by importing the `QtInteractor <https://qtdocs.pyvista.org/api_reference.html#qtinteractor>`_ class from the ``pyvistaqt`` package and the :class:`MapdlTheme <ansys.mapdl.core.theme.MapdlTheme>` class from the ``ansys-mapdl-core`` package:
Start by importing the `QtInteractor <https://qtdocs.pyvista.org/api_reference.html#qtinteractor>`_
class from the ``pyvistaqt`` package and the :class:`MapdlTheme <ansys.mapdl.core.theme.MapdlTheme>`
class from the ``ansys-mapdl-core`` package:

.. code:: python
Expand Down
2 changes: 1 addition & 1 deletion doc/source/examples/extended_examples/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ with other programs, libraries, and features in development.
+----------------------------+--------------------------------------------------------------------------------------------+
| `Cart-Pole Simulation`_ | Demonstrates a reinforcement machine learning example using MAPDL through PyMAPDL. |
+----------------------------+--------------------------------------------------------------------------------------------+
| :ref:`extended_example01` | Demonstrates the interoperability between PyMAPDL and the `gmsh <gmsh_>`_ meshing library. |
| :ref:`extended_example01` | Demonstrates the interoperability between PyMAPDL and the `Gmsh <gmsh_>`_ meshing library. |
+----------------------------+--------------------------------------------------------------------------------------------+
| :ref:`python_upf_examples` | Demonstrates the interoperability between user-programmable functions in MAPDL and Python. |
+----------------------------+--------------------------------------------------------------------------------------------+
Expand Down
2 changes: 1 addition & 1 deletion doc/source/getting_started/running_mapdl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ the mentioned IP address/hostname for this to work.
If you have MAPDL installed on your local host, you
can use the :func:`launch_mapdl() <ansys.mapdl.core.launch_mapdl>` method to both start and connect to MAPDL.

If you have any problem launching PyMAPDL, see :ref:`debugging_launch_mapdl`.
If you have any problem launching PyMAPDL, see :ref:`Launching issues <ref_launching_issue>`.

If you are connecting to an MAPDL Docker image, the procedure is the same.
Just make sure that you specify the mapped port instead of the internal Docker image port.
Expand Down
33 changes: 18 additions & 15 deletions doc/source/user_guide/convert.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Translate scripts
===================

The `ansys-mapdl-core <pymapdl_docs_>`_
library contains a few basic functions to translate existing MAPDL
scripts into PyMAPDL scripts. Ideally, all math and variable setting
Expand All @@ -8,7 +9,7 @@ are less transparent and more difficult to debug.


Command-line interface
~~~~~~~~~~~~~~~~~~~~~~
----------------------

In PyMAPDL v0.64.0 and later, you use the converter from the command line.
After you have activated and installed the package as described
Expand Down Expand Up @@ -40,7 +41,7 @@ The ``pymapdl_convert_script`` command uses the
Hence, this command accepts most of this function's arguments.

Usage
-----
~~~~~

You can call this command from the terminal with different
arguments. Here is an example that converts the ``mapdl.dat``
Expand Down Expand Up @@ -90,12 +91,13 @@ function documentation.

Caveats
~~~~~~~

These examples only show an automatic translation of a verification:
file and not optimized code. Should it be necessary to pull
parameters or arrays from ansys, use the :func:`Mapdl.get_value()
<ansys.mapdl.core.Mapdl.get_value>` function, which is quite similar to the
MAPDL :func:`Mapdl.get() <ansys.mapdl.core.Mapdl.get>`
command shown here:
parameters or arrays from ansys, use the
:func:`Mapdl.get_value() <ansys.mapdl.core.Mapdl.get_value>` function,
which is quite similar to the MAPDL
:func:`Mapdl.get() <ansys.mapdl.core.Mapdl.get>` command shown here:

.. code:: pycon
Expand All @@ -122,6 +124,7 @@ with:
Script translation
~~~~~~~~~~~~~~~~~~

Existing Ansys scripts can be translated using the :func:`convert_script() <ansys.mapdl.core.convert_script>`
function:

Expand Down Expand Up @@ -151,15 +154,14 @@ Or, you can convert code in form of strings for later processing using the
The script conversion functions allow some interesting arguments, which you can see in
the respective :func:`convert_script() <ansys.mapdl.core.convert_script>`
and :func:`convert_apdl_block() <ansys.mapdl.core.convert_apdl_block>`
function documentation. Especially interesting are the ``add_imports``, ``comment_solve``, and
``print_com`` keyword arguments.

Of particular note in the following examples is how most of the
commands can be called as a method to the Ansys object rather than
sending a string as a command. Additionally, take note that some
commands require the :attr:`Mapdl.non_interactive
<ansys.mapdl.core.Mapdl.non_interactive>` context manager since some
commands require and may break the server connection for some
function documentation. Especially interesting are the ``add_imports``, ``comment_solve``,
and ``print_com`` keyword arguments.

Of particular note in the following examples is how most of the commands can be called
as a method to the Ansys object rather than sending a string as a command. Additionally,
take note that some commands require the
:attr:`Mapdl.non_interactive <ansys.mapdl.core.Mapdl.non_interactive>`
context manager since some commands require and may break the server connection for some
interfaces (such as CORBA) or are invalid (as in gRPC).

Also note that APDL macros that use ``*CREATE`` have been replaced
Expand All @@ -169,6 +171,7 @@ should it be necessary to insert a ``breakpoint()`` in the script.

Example: VM1 - statically indeterminate reaction force analysis
---------------------------------------------------------------

Ansys MAPDL contains over 200 verification files used for Ansys
validation and demonstration. These validation files are used here to
demo the use of the PyMAPDL file translator :func:`convert_script()
Expand Down
2 changes: 1 addition & 1 deletion doc/source/user_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,4 @@ with it. For example:
recommended.
For stability considerations, see :ref:`ref_pymapdl_stability`.
For stability considerations, see :ref:`PyMAPDL stability <ref_pymapdl_stability>`.
15 changes: 8 additions & 7 deletions doc/source/user_guide/mapdl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ Additionally, MAPDL commands
containing a ``/`` or ``*`` have had those characters removed, unless
this causes a conflict with an existing name. Most notable is
``/SOLU``, which would conflict with ``SOLU``. Therefore,
``/SOLU`` is renamed to the :func:`Mapdl.slashsolu()
<ansys.mapdl.core.Mapdl.slashsolu>` method to differentiate it from ``solu``.
``/SOLU`` is renamed to the
:func:`Mapdl.slashsolu() <ansys.mapdl.core.Mapdl.slashsolu>`
method to differentiate it from ``solu``.
Out of the 1500 MAPDL commands, about 15 start with ``slash (/)`` and 8
start with ``star (*)``.

Expand Down Expand Up @@ -341,9 +342,9 @@ example:
Prompts
~~~~~~~
Prompts from MAPDL automatically continued as if MAPDL is in batch
mode. Commands requiring user input, such as the :func:`Mapdl.vwrite()
<ansys.mapdl.core.Mapdl.vwrite>` method fail and must be entered in
non-interactively.
mode. Commands requiring user input, such as the
:func:`Mapdl.vwrite() <ansys.mapdl.core.Mapdl.vwrite>` method fail
and must be entered in non-interactively.


APDL command logging
Expand Down Expand Up @@ -618,8 +619,8 @@ using the :attr:`Mapdl.chain_commands <ansys.mapdl.core.Mapdl.chain_commands>` a
The execution time using this approach is generally 4 to 10 times faster than running
each command individually. You can then view the final response of
the chained commands with the :attr:`Mapdl.last_response
<ansys.mapdl.core.Mapdl.last_response>` attribute.
the chained commands with the
:attr:`Mapdl.last_response <ansys.mapdl.core.Mapdl.last_response>` attribute.

.. note::
Command chaining is not supported in distributed MAPDL. To improve
Expand Down
12 changes: 7 additions & 5 deletions doc/source/user_guide/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
*********************************
Setting and retrieving parameters
*********************************
APDL parameters can be retrieved from and instance of :class:`Mapdl
<ansys.mapdl.core.mapdl._MapdlCore>` using the :attr:`Mapdl.parameters
<ansys.mapdl.core.Mapdl.parameters>`. For example, if you want to use
MAPDL's :func:`Mapdl.get() <ansys.mapdl.core.Mapdl.get>` method to
APDL parameters can be retrieved from and instance of
:class:`Mapdl <ansys.mapdl.core.mapdl._MapdlCore>`
using the :attr:`Mapdl.parameters <ansys.mapdl.core.Mapdl.parameters>`.
For example, if you want to use MAPDL's
:func:`Mapdl.get() <ansys.mapdl.core.Mapdl.get>` method to
populate a parameter, you can then access the parameter with code:

.. code:: pycon
Expand Down Expand Up @@ -46,7 +47,8 @@ ROUT``, you can access it with this code:
For a full list of the methods and attributes available to the
``Parameters`` class, see :ref:`ref_parameters_api`.

For additional information on PyMAPDL array limitations, see :ref:`ref_numpy_arrays_in_mapdl`.
For additional information on PyMAPDL array limitations, see
:ref:`Issues when importing and exporting numpy arrays in MAPDL <ref_issues_np_mapdl>`.

.. _ref_special_named_param:

Expand Down
10 changes: 5 additions & 5 deletions doc/source/user_guide/plotting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ You plot lines within Python using the :func:`Mapdl.lplot() <ansys.mapdl.core.Ma
Area and volume plotting
~~~~~~~~~~~~~~~~~~~~~~~~
You can using Boolean operations to obtain more complex geometry and
visualize them using the :func:`Mapdl.vplot()
<ansys.mapdl.core.Mapdl.vplot>` method. This example cuts the initial
area with the eight circles and then extrudes it.
visualize them using the :func:`Mapdl.vplot() <ansys.mapdl.core.Mapdl.vplot>`
method. This example cuts the initial area with the eight circles and then
extrudes it.

.. code:: pycon
Expand Down Expand Up @@ -202,8 +202,8 @@ method:

.. note::
Because boundary conditions can only target nodes, you can
only use ``plot_bc`` as an argument in the :func:`Mapdl.nplot()
<ansys.mapdl.core.Mapdl.nplot>` method.
only use ``plot_bc`` as an argument in the
:func:`Mapdl.nplot() <ansys.mapdl.core.Mapdl.nplot>` method.



Expand Down
11 changes: 5 additions & 6 deletions doc/source/user_guide/pool.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

Create a pool of MAPDL instances
================================
PyMAPDL contains the :class:`LocalMapdlPool
<ansys.mapdl.core.LocalMapdlPool>` class to simplify creating multiple
local instances of the :class:`Mapdl <ansys.mapdl.core.mapdl._MapdlCore>`
class for batch processing. This can be used for the batch processing of a
set of input files, convergence analysis, or other batch related
processes.
PyMAPDL contains the :class:`LocalMapdlPool <ansys.mapdl.core.LocalMapdlPool>`
class to simplify creating multiple local instances of the
:class:`Mapdl <ansys.mapdl.core.mapdl._MapdlCore>` class for batch processing.
This can be used for the batch processing of a set of input files,
convergence analysis, or other batch related processes.

This code creates a pool:

Expand Down
Loading

0 comments on commit 32743f0

Please sign in to comment.