Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing vale warning #2394

Merged
merged 50 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
abe810d
fix: vale warning
clatapie Oct 6, 2023
abf7a61
Merge branch 'main' into fix/codestyle
clatapie Oct 6, 2023
8952c3a
Apply suggestions from code review
clatapie Oct 6, 2023
3d783e1
fix: `troubleshoot.rst`
clatapie Oct 6, 2023
dea400f
Merge branch 'fix/codestyle' of https://github.com/ansys/pymapdl into…
clatapie Oct 6, 2023
8d63aa8
fix: .vale
clatapie Oct 6, 2023
f9458e5
test: adding code and tt in `SkippedScopes`
clatapie Oct 6, 2023
48d43f1
fix: vale checks
clatapie Oct 6, 2023
f4f3da8
fix: moving .vale.ini
clatapie Oct 6, 2023
185c345
maint: affing `vale-config` path
clatapie Oct 6, 2023
6e69e9a
Merge branch 'main' into fix/codestyle
clatapie Oct 6, 2023
3a164f6
maint: removing skip
clatapie Oct 6, 2023
e3bddb8
maint: fixing .vale.ini
clatapie Oct 6, 2023
fe8793e
Merge branch 'main' into fix/codestyle
clatapie Oct 6, 2023
7022169
maint: reverting changes with `.vale.ini` location
clatapie Oct 9, 2023
cfcc528
fix: `StylesPath` in `.vale.ini`
clatapie Oct 9, 2023
f09ea0c
Merge branch 'main' into fix/codestyle
clatapie Oct 9, 2023
bff477c
fix: vale configuration to ignore `class` and `func`
clatapie Oct 11, 2023
e9d492d
fix: `.vale.ini`
clatapie Oct 11, 2023
def856f
Merge branch 'main' into fix/codestyle
clatapie Oct 11, 2023
51c465a
fix: adding :attr: in TokenIgnores
clatapie Oct 11, 2023
ac5719d
fix: adding `:meth:` in TokenIgnores
clatapie Oct 11, 2023
9cabcf6
fix: vale warnings
clatapie Oct 11, 2023
b7400b8
fix: applying Revathy's review
clatapie Oct 11, 2023
3ef1bea
fix: vale check
clatapie Oct 11, 2023
df3cd0f
fic: ignoring vale for links
clatapie Oct 11, 2023
3f70faa
fix: `.vale.ini`
clatapie Oct 11, 2023
10811f0
fix: `.vale.ini` configuration
clatapie Oct 11, 2023
51bf5a1
fix: applying Revathy's review
clatapie Oct 11, 2023
fb80b15
fic: `.vale.ini` configuration
clatapie Oct 11, 2023
adb3916
doc: applying fixes from vale warnings
clatapie Oct 11, 2023
c706b2c
Update doc/.vale.ini
clatapie Oct 11, 2023
e80ce17
doc: fixes references and formatting
clatapie Oct 11, 2023
a3aeced
maint: updating cicd
clatapie Oct 11, 2023
6a03a65
fix: adding ref in `troubleshoots.rst`
clatapie Oct 11, 2023
70e07d9
Merge branch 'main' into fix/codestyle
clatapie Oct 11, 2023
03be46e
fix: reverting changes from `.vale.ini`
clatapie Oct 13, 2023
3f000b6
fix: updating `TokenIgnores`
clatapie Oct 13, 2023
702da64
Merge branch 'main' into fix/codestyle
clatapie Oct 13, 2023
71e6a9d
fix: adding `py` in `TokenIgnores`
clatapie Oct 13, 2023
c0287c0
Merge branch 'fix/codestyle' of https://github.com/pyansys/pymapdl in…
clatapie Oct 13, 2023
7a55fd7
maint: removing [Mm]apdl as accepted words
clatapie Oct 13, 2023
c805aa1
fix: skipping code sections
clatapie Oct 13, 2023
0423478
Update doc/source/user_guide/mapdl.rst
clatapie Oct 13, 2023
b5532ab
Update the image cache
clatapie Oct 13, 2023
5502a03
Merge branch 'main' into fix/codestyle
germa89 Oct 16, 2023
0ed79fa
Merge branch 'main' into fix/codestyle
germa89 Oct 16, 2023
2c25672
Update the image cache
germa89 Oct 16, 2023
241fc57
Empty comment to trigger CICD
germa89 Oct 16, 2023
db6da8e
Merge branch 'fix/codestyle' of https://github.com/pyansys/pymapdl in…
germa89 Oct 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 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
65 changes: 34 additions & 31 deletions doc/.vale.ini
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
# Core settings
# =============

# Location of our `styles`
StylesPath = "styles"

# The options are `suggestion`, `warning`, or `error` (defaults to “warning”).
MinAlertLevel = warning

# By default, `code` and `tt` are ignored.
IgnoredScopes = code, tt

# By default, `script`, `style`, `pre`, and `figure` are ignored.
SkippedScopes = script, style, pre, figure

# WordTemplate specifies what Vale will consider to be an individual word.
WordTemplate = \b(?:%s)\b

# List of Packages to be used for our guidelines
Packages = Google

# Define the Ansys vocabulary
Vocab = ANSYS

[*.{md,rst}]

# Apply the following styles
BasedOnStyles = Vale, Google

# Removing Google-specific rule - Not applicable under some circumstances
Google.Colons = NO
# Core settings
# =============

# Location of our `styles`
StylesPath = "styles"

# The options are `suggestion`, `warning`, or `error` (defaults to “warning”).
MinAlertLevel = warning

# By default, `code` and `tt` are ignored.
IgnoredScopes = code, tt

# By default, `script`, `style`, `pre`, and `figure` are ignored.
SkippedScopes = script, style, pre, figure

# WordTemplate specifies what Vale will consider to be an individual word.
WordTemplate = \b(?:%s)\b

# List of Packages to be used for our guidelines
Packages = Google

# Define the Ansys vocabulary
Vocab = ANSYS

[*.{md,rst}]

# Apply the following styles
BasedOnStyles = Vale, Google

# `class` and `func` are ignored
TokenIgnores = (:.*:`.*`)|(<.*>)

clatapie marked this conversation as resolved.
Show resolved Hide resolved
clatapie marked this conversation as resolved.
Show resolved Hide resolved
# Removing Google-specific rule - Not applicable under some circumstances
Google.Colons = NO
4 changes: 2 additions & 2 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 @@
To show how the coverage works, assume that you have
this library:

**My awesome library**

Check warning on line 37 in doc/source/api/unit_testing.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/api/unit_testing.rst#L37

[Google.FirstPerson] Avoid first-person pronouns such as 'My'.
Raw output
{"message": "[Google.FirstPerson] Avoid first-person pronouns such as 'My'.", "location": {"path": "doc/source/api/unit_testing.rst", "range": {"start": {"line": 37, "column": 3}}}, "severity": "WARNING"}


.. code:: python
Expand Down Expand Up @@ -82,12 +82,12 @@
more useful for debugging the function.


Continuous Integration and Continuous Deployment (CI/CD) approach

Check warning on line 85 in doc/source/api/unit_testing.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/api/unit_testing.rst#L85

[Google.Headings] 'Continuous Integration and Continuous Deployment (CI/CD) approach' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'Continuous Integration and Continuous Deployment (CI/CD) approach' should use sentence-style capitalization.", "location": {"path": "doc/source/api/unit_testing.rst", "range": {"start": {"line": 85, "column": 1}}}, "severity": "WARNING"}
-----------------------------------------------------------------

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

Check warning on line 90 in doc/source/api/unit_testing.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/api/unit_testing.rst#L90

[Google.WordList] Use 'app' instead of 'application'.
Raw output
{"message": "[Google.WordList] Use 'app' instead of 'application'.", "location": {"path": "doc/source/api/unit_testing.rst", "range": {"start": {"line": 90, "column": 55}}}, "severity": "WARNING"}
lifecycle, providing a comprehensive CI/CD approach.

.. figure:: ../images/cicd.jpg
Expand Down Expand Up @@ -119,7 +119,7 @@
MAPDL, which makes them integration tests. If your test
requires a running MAPDL instance, you can use the PyMAPDL
`mapdl <mapdl_fixture_>`_ method in your function signature.
It will be executed upstream of each test and not within all tests.

Check warning on line 122 in doc/source/api/unit_testing.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/api/unit_testing.rst#L122

[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "doc/source/api/unit_testing.rst", "range": {"start": {"line": 122, "column": 4}}}, "severity": "WARNING"}

.. code:: python

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
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
21 changes: 11 additions & 10 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 All @@ -35,9 +36,9 @@ Or, these commands can be called using keyword arguments:

mapdl.esel("s", "type", vmin=1)

None of these restrictions apply to commands run with the :func:`Mapdl.run()
<ansys.mapdl.core.Mapdl.run>` method. It might be easier to run some of
these commands, such as ``"/SOLU"``:
None of these restrictions apply to commands run with the
:func:`Mapdl.run() <ansys.mapdl.core.Mapdl.run>` method. It might be easier
to run some of these commands, such as ``"/SOLU"``:
clatapie marked this conversation as resolved.
Show resolved Hide resolved

.. code:: python

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.
germa89 marked this conversation as resolved.
Show resolved Hide resolved

.. note::
Command chaining is not supported in distributed MAPDL. To improve
Expand Down
9 changes: 5 additions & 4 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
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
Loading