Skip to content

Implementing vale #1644

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

Merged
merged 20 commits into from
Nov 28, 2022
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
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
26 changes: 16 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,28 @@ permissions:

jobs:

stylecheck:
name: Style Check
style:
name: Code style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/[email protected]
- name: PyAnsys code style checks
uses: pyansys/actions/code-style@v1
with:
python-version: 3.9
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )

doc-style:
name: Documentation style check
runs-on: ubuntu-latest
steps:
- name: PyAnsys documentation style checks
uses: pyansys/actions/doc-style@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

testimport:
name: Smoke Tests
runs-on: ${{ matrix.os }}
needs: [style]
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
Expand Down Expand Up @@ -116,11 +121,11 @@ jobs:
docs_build:
name: Build Documentation
runs-on: ubuntu-latest
needs: [doc-style]
env:
PYMAPDL_PORT: 21000 # default won't work on GitHub runners
PYMAPDL_DB_PORT: 21001 # default won't work on GitHub runners
PYMAPDL_START_INSTANCE: FALSE

steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -304,6 +309,7 @@ jobs:
build_test:
name: Build and Unit Testing
runs-on: ubuntu-latest
needs: [style]
strategy:
matrix:
mapdl-version: ['v21.1.1', 'v21.2.1', 'v22.1.0', 'v22.2.0', 'v22.2-ubuntu']
Expand Down
31 changes: 31 additions & 0 deletions doc/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 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
4 changes: 3 additions & 1 deletion doc/source/404.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
:orphan:

.. vale off

Oops!
=====

.. vale on

This is unexpected.

Expand Down
30 changes: 19 additions & 11 deletions doc/source/contribution_and_api/building_example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,50 +31,58 @@ 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.
The dynamic examples are based on Python files and must be able to run in under three minutes.

They are in the ``examples`` directory inside this repository.
They are in the ``examples`` directory in this repository.

.. vale off

Example: `2d_plate_with_a_hole.py <https://github.com/pyansys/pymapdl/blob/main/examples/00-mapdl-examples/2d_plate_with_a_hole.py>`_
.. vale on

It is published on the following link:
Here is a link to this dynamic example:
`MAPDL 2D Plane Stress Concentration Analysis <https://mapdl.docs.pyansys.com/examples/gallery_examples/00-mapdl-examples/2d_plate_with_a_hole.html#sphx-glr-examples-gallery-examples-00-mapdl-examples-2d-plate-with-a-hole-py>`_

They will be executed and the mention **Total running time of the script** will appear at the end of
When an example is executed, **Total running time of the script** appears at the end of
the document.


Static examples
---------------

They are based on RST files and will not be executed.
Static examples are based on RST files and are not executed.

They are in the ``doc\source`` directory.

.. vale off

Example: `krylov_example.rst <https://raw.githubusercontent.com/pyansys/pymapdl/main/doc/source/examples/extended_examples/Krylov/krylov_example.rst>`_
.. vale on

It is published on the following link: `Harmonic analysis using the frequency-sweep Krylov method <https://mapdl.docs.pyansys.com/examples/extended_examples/Krylov/krylov_example.html>`_
Here is a link to this static example: `Harmonic analysis using the frequency-sweep Krylov method <https://mapdl.docs.pyansys.com/examples/extended_examples/Krylov/krylov_example.html>`_


Semi-dynamic examples
---------------------

They are RST files which execute Python code using this RST directive:
Semi-dynamic examples are RST files that execute Python code using this RST directive:

.. code:: bash

.. jupyter-execute::
:hide-code:


.. vale off

Example: `tecfricstir.rst <https://raw.githubusercontent.com/pyansys/pymapdl/main/doc/source/examples/technology_showcase_examples/techdemo-28/ex_28-tecfricstir.rst>`_
.. vale on

It is visible at the following link: `Friction Stir Welding (FSW) Simulation <https://mapdl.docs.pyansys.com/examples/technology_showcase_examples/techdemo-28/ex_28-tecfricstir.html>`_
Here is a link to this semi-dynamic example: `Friction Stir Welding (FSW) Simulation <https://mapdl.docs.pyansys.com/examples/technology_showcase_examples/techdemo-28/ex_28-tecfricstir.html>`_


Recommendations
---------------

As the dynamic examples are examples that have to be run at each Documentation build, 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.
As dynamic examples must run each time documentation is built, make sure that they are very short.
To get around the problem of execution time, feel free to use static or semi-static examples.
2 changes: 1 addition & 1 deletion doc/source/contribution_and_api/commands.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _ref_commands_api:

Commands Output
Commands output
===============

Various PyMAPDL classes and commands which helps in data post-processing.
Expand Down
2 changes: 1 addition & 1 deletion doc/source/contribution_and_api/helper.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _launcher_api:

Helper Functions
Helper functions
================
These methods simplify launching MAPDL, converting existing scripts,
or automating other tasks.
Expand Down
22 changes: 11 additions & 11 deletions doc/source/contribution_and_api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ contribute to PyMAPDL.
The following contribution information is specific to PyMAPDL.


Cloning the PyMAPDL Repository
Cloning the PyMAPDL repository
==============================

Run this code to clone and install the latest version of PyMAPDL in development mode:
Expand All @@ -26,12 +26,12 @@ Run this code to clone and install the latest version of PyMAPDL in development
pip install -e .


Posting Issues
Posting issues
==============

Use the `PyMAPDL Issues <pymapdl_issues_>`_
page to submit questions, report bugs, and request new features. When possible, we
recommend that you use these issue templates:
page to submit questions, report bugs, and request new features. When possible,
use these issue templates:

* Bug report template
* Feature request template
Expand All @@ -40,7 +40,7 @@ If your issue does not fit into one of these categories, create your own issue.

To reach the project support team, email `[email protected] <pyansys_support_>`_.

Viewing PyMAPDL Documentation
Viewing PyMAPDL documentation
=============================

Documentation for the latest stable release of PyMAPDL is hosted at
Expand Down Expand Up @@ -77,7 +77,7 @@ This tells ``ansys.mapdl.core`` to attempt to connect to the existing
MAPDL service by default when the ``launch_mapdl`` function is used.


Code Style
Code style
==========

PyMAPDL follows PEP8 standard as outlined in the `PyAnsys Development Guide
Expand Down Expand Up @@ -105,16 +105,16 @@ This way, it's not possible for you to push code that fails the style checks. Fo

.. _ref_index_api:

API Reference
API reference
=============
This page gives an overview of the API of several public PyMAPDL
classes, functions, and attributes. You can find them
on the left sidebar.

These methods may include some MAPDL commands but are generally
specific to pymapdl specific methods and classes (i.e. methods that
extend existing MAPDL methods in a pythonic manner). For classic
MAPDL commands mapped to PyMAPDL, see :ref:`ref_mapdl_commands`.
While these methods might include some MAPDL commands, they are generally
specific to PyMAPDL methods and classes. PyMAPDL methods extend existing
MAPDL methods in a Pythonic manner. For a mapping of MAPDL commands to
PyMAPDL, see :ref:`ref_mapdl_commands`.


.. toctree::
Expand Down
2 changes: 1 addition & 1 deletion doc/source/contribution_and_api/inline.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _inline_functions_api:

Inline Functions
Inline functions
================

.. currentmodule:: ansys.mapdl.core.inline_functions
Expand Down
4 changes: 2 additions & 2 deletions doc/source/contribution_and_api/krylov.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _ref_krylov_api:

KrylovSolver
============
``KrylovSolver`` module
=======================
These classes are specific to the ``KrylovSolver`` module:

.. currentmodule:: ansys.mapdl.core
Expand Down
15 changes: 8 additions & 7 deletions doc/source/contribution_and_api/mapdl.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
.. _ref_mapdl_api:

Mapdl
=====
``Mapdl`` module
================

``Mapdl`` methods and attributes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Mapdl Class Specific Classes or Attributes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. currentmodule:: ansys.mapdl.core

.. autoclass:: ansys.mapdl.core.mapdl._MapdlCore
Expand Down Expand Up @@ -46,7 +47,7 @@ Constants
plotting.BCS


Latest 2021R1 and newer features
``mapdl_grpc.MapdlGrpc`` methods
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: ansys.mapdl.core.mapdl_grpc.MapdlGrpc
Expand All @@ -62,8 +63,8 @@ Latest 2021R1 and newer features
mapdl_grpc.MapdlGrpc.upload


Mapdl Information Class
~~~~~~~~~~~~~~~~~~~~~~~
``Information`` class attributes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. currentmodule:: ansys.mapdl.core.misc

Expand Down
4 changes: 2 additions & 2 deletions doc/source/contribution_and_api/math.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _ref_math_api:

MapdlMath
=========
``MapdlMath`` module
====================
These classes are specific to the ``MapdlMath`` module:

.. currentmodule:: ansys.mapdl.core
Expand Down
2 changes: 1 addition & 1 deletion doc/source/contribution_and_api/pool.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _ref_pool_api:

Local MAPDL Pool
Local MAPDL pool
================

.. currentmodule:: ansys.mapdl.core
Expand Down
16 changes: 8 additions & 8 deletions doc/source/contribution_and_api/post.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
.. _post_processing_api:


Post-Processing
===============
``PostProcessing`` class
========================

This class contains an API to post-process directly from MAPDL.
Should you wish to post-process MAPDL result files outside of PyMAPDL,
you can use one of the following packages:
The ``PostProcessing`` class supports postprocessing directly from MAPDL.
If you want to postprocess MAPDL result files outside of PyMAPDL,
you can use one of these packages:

* `DPF-Core <dpf_core_docs_>`_ : Post-Processing using the Data Processing Framework (DPF). More complex yet and more powerful post-processing APIs.
* `DPF-Post <dpf_post_docs_>`_ : Streamlined and simplified DPF Post Processing. Higher level package and uses ``DPF-Core``.
* `Legacy PyMAPDL Reader <legacy_reader_docs_>`_: Legacy result file reader. Supports result files from MAPDL v14.5 to the current release.
* `PyDPF-Core <dpf_core_docs_>`_ : Postprocessing using the Data Processing Framework (DPF). DPF-Core provides more complex and more powerful postprocessing APIs.
* `PyDPF-Post <dpf_post_docs_>`_ : Streamlined and simplified DPF postprocessing. PyDPF-Post is a higher-level package that uses PyDPF-Core.
* `PyMAPDL Reader <legacy_reader_docs_>`_: Legacy result file reader. PyMAPDL Reader supports result files for MAPDL 14.5 and later.

.. currentmodule:: ansys.mapdl.core

Expand Down
2 changes: 1 addition & 1 deletion doc/source/contribution_and_api/xpl.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _ref_xpl_api:

Database Explorer
Database explorer
=================
.. currentmodule:: ansys.mapdl.core

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ These are the main steps required:

Perform required imports
------------------------
Perform required imports and launch mapdl.
Perform required imports and launch MAPDL.

.. code:: ipython3

Expand Down
Loading