Skip to content

Commit 5353358

Browse files
dipinknairMaxJPReyPipKatRobPasMue
authored
Modify documentation (#399)
* Removing redundant code blocks * remove sg_execution_times gitignore * - python version correction - image size - checklist modification - table modification * Update doc/source/how-to/setting-up.rst Review feedback Co-authored-by: Maxime Rey <[email protected]> * Adjust specing of lines * update python supporting versions * Apply suggestions from code review Review from @PipKat Co-authored-by: Kathy Pippert <[email protected]> * Update doc/source/doc-style/formatting-tools.rst Co-authored-by: Kathy Pippert <[email protected]> * Update doc/source/coding-style/formatting-tools.rst Co-authored-by: Kathy Pippert <[email protected]> * Update doc/source/doc-style/formatting-tools.rst Co-authored-by: Kathy Pippert <[email protected]> * Apply suggestions from code review Feedback from @PipKat Co-authored-by: Kathy Pippert <[email protected]> * Update doc/source/how-to/logging.rst Co-authored-by: Kathy Pippert <[email protected]> * Update doc/source/how-to/setting-up.rst Co-authored-by: Kathy Pippert <[email protected]> * Update doc/source/how-to/setting-up.rst Co-authored-by: Kathy Pippert <[email protected]> * Update doc/source/how-to/setting-up.rst Co-authored-by: Kathy Pippert <[email protected]> * Update doc/source/how-to/setting-up.rst Co-authored-by: Kathy Pippert <[email protected]> * Update doc/source/how-to/setting-up.rst Co-authored-by: Kathy Pippert <[email protected]> * Update doc/source/how-to/setting-up.rst Co-authored-by: Kathy Pippert <[email protected]> * vale check * vale feedback --------- Co-authored-by: Maxime Rey <[email protected]> Co-authored-by: Kathy Pippert <[email protected]> Co-authored-by: Roberto Pastor Muela <[email protected]>
1 parent d1e3761 commit 5353358

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+363
-486
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,7 @@ cython_debug/
165165

166166
# Sphinx autogen
167167
doc/source/how-to/api/*
168+
doc/source/sg_execution_times.rst
169+
170+
# rstcheck
171+
.rstcheck.cfg

README.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#########################
2-
PyAnsys Developer's Guide
3-
#########################
41

5-
The `PyAnsys Developer's Guide <https://dev.docs.pyansys.com>`_ is the central
2+
PyAnsys developer's guide
3+
=========================
4+
5+
The `PyAnsys developer's guide <https://dev.docs.pyansys.com>`_ is the central
66
document for:
77

88
- Ansys developers who want to create and "own" PyAnsys libraries

doc/source/abstractions/data-transfer.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,16 @@ within the MAPDL database.
6969
7070
REST versus RPC data and model abstraction
7171
------------------------------------------
72+
7273
Because of the nature of most Ansys products, apps and
7374
services can either fit into the Remote Procedure Call (RPC) interface,
7475
where the API is centered around operations and commands, or the
7576
REST model, where the API is centered around resources. Regardless of
7677
the interface style, there are several items to consider.
7778

78-
7979
API chattiness
8080
~~~~~~~~~~~~~~
81+
8182
APIs must be efficient to avoid creating chatty input and output.
8283
Because many Ansys products fit well with the RPC API implementation,
8384
there is a temptation to design APIs that require constant communication
@@ -93,6 +94,7 @@ expose only a limited number of RPC methods in the front-facing API.
9394

9495
Compatibility and efficiency
9596
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
97+
9698
APIs should be designed to be compatible with as many languages and
9799
platforms as possible. `gRPC`_ for RPC-like interfaces should be one
98100
of the first choices due to its compatibility with nearly all popular

doc/source/abstractions/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Abstractions
2-
############
2+
============
33

44
Abstraction in Python is the process of hiding the real implementation
55
of an app from the user and emphasizing only usage.

doc/source/coding-style/code/tox-flit.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
[tox]
44
description = Default tox environments list
55
envlist =
6-
style,{py37,py38,py39,py310}{,-coverage},doc
6+
style,{py39,py310,py311,py312}{,-coverage},doc
77
skip_missing_interpreters = true
88
isolated_build = true
99
isolated_build_env = build
1010
1111
[testenv]
1212
description = Checks for project unit tests and coverage (if desired)
1313
basepython =
14-
py37: python3.7
15-
py38: python3.8
1614
py39: python3.9
1715
py310: python3.10
16+
py311: python3.11
17+
py312: python3.12
1818
py: python3
1919
{style,reformat,doc,build}: python3
2020
setenv =

doc/source/coding-style/code/tox-poetry.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
[tox]
44
description = Default tox environments list
55
envlist =
6-
style,{py37,py38,py39,py310}{,-coverage},doc
6+
style,{py39,py310,py311,py312}{,-coverage},doc
77
skip_missing_interpreters = true
88
isolated_build = true
99
1010
[testenv]
1111
description = Checks for project unit tests and coverage (if desired)
1212
basepython =
13-
py37: python3.7
14-
py38: python3.8
1513
py39: python3.9
1614
py310: python3.10
15+
py311: python3.11
16+
py312: python3.12
1717
py: python3
1818
{style,reformat,doc,build}: python3
1919
skip_install = true

doc/source/coding-style/deprecation.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Deprecation best practices
22
==========================
3+
34
While deprecation best practices are outlined in a `Stack
45
Overflow Answer <https://stackoverflow.com/questions/2536307>`_ and
56
in this `Deprecation library <https://deprecation.readthedocs.io/>`_ ,

doc/source/coding-style/formatting-tools.rst

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ Most of the tools presented can be configured using :ref:`the
99
\`\`pyproject.toml\`\` file`. Avoiding dotfiles leads to a much
1010
cleaner root project directory.
1111

12-
1312
Black
1413
-----
14+
1515
`Black`_ is the most popular code formatter in the Python community because it is
1616
maintained by the Python Software Foundation. It allows for a minimum
1717
configuration to ensure that the Python code format looks almost the same across
@@ -28,17 +28,17 @@ The minimum `black`_ configuration for a PyAnsys project should look like this:
2828
line-length = "<length>"
2929

3030

31-
Isort
32-
-----
31+
The ``isort``
32+
-------------
33+
3334
The goal of `isort`_ is to properly format ``import`` statements by making sure
3435
that they follow the standard order:
3536

3637
#. library
3738
#. third-party libraries
3839
#. custom libraries
3940

40-
41-
When using `isort`_ with `black`_, it is important to properly configure both
41+
When using `isort`_ with `Black`_, it is important to properly configure both
4242
tools so that no conflicts arise. To accomplish this, use the
4343
``--profile black`` flag in `isort`_.
4444

@@ -51,11 +51,11 @@ tools so that no conflicts arise. To accomplish this, use the
5151
default_section = "THIRDPARTY"
5252
src_paths = ["doc", "src", "tests"]
5353

54-
5554
Flake8
5655
------
57-
The goal of `flake8` is to act as a `PEP 8`_ compliance checker. Again, if
58-
this tool is being used with `black`_, it is important to make sure that no
56+
57+
The goal of `Flake8` is to act as a `PEP 8`_ compliance checker. Again, if
58+
this tool is being used with `Black`_, it is important to make sure that no
5959
conflicts arise.
6060

6161
The following configuration is the minimum one to set up `flake8`_ together with
@@ -100,6 +100,7 @@ The example configuration defines these options:
100100

101101
Add-license-headers
102102
-------------------
103+
103104
The goal of the ``add-license-headers`` pre-commit hook is to add and update license headers
104105
for files with `REUSE <https://reuse.software/>`_. By default, the hook runs on
105106
PROTO files in any directory and on Python files in the ``src``, ``examples``, and ``tests`` directories.
@@ -110,9 +111,9 @@ You can find the MIT license that is added to the files in
110111

111112
For information on customizing the hook, see the `README <https://github.com/ansys/pre-commit-hooks/blob/main/README.rst>` file.
112113

113-
114114
Code coverage
115115
-------------
116+
116117
Code coverage indicates the percentage of the codebase tested by the test
117118
suite. Code coverage should be as high as possible to guarantee that every piece
118119
of code has been tested.
@@ -132,8 +133,9 @@ project:
132133
[tool.coverage.report]
133134
show_missing = true
134135

135-
Pre-commit
136-
----------
136+
The ``pre-commit``
137+
------------------
138+
137139
To ensure that every commit you make is compliant with the code style
138140
guidelines for PyAnsys, you can take advantage of `pre-commit`_ in your project.
139141
Every time you stage some changes and try to commit them, `pre-commit`_ only
@@ -144,7 +146,6 @@ The configuration for `pre-commit`_ must be defined in a
144146
`pre-commit`_ configuration that includes both code and documentation
145147
formatting tools.
146148

147-
148149
.. code-block:: yaml
149150

150151
repos:
@@ -183,6 +184,7 @@ formatting tools.
183184

184185
Installing ``pre-commit``
185186
~~~~~~~~~~~~~~~~~~~~~~~~~
187+
186188
You can install ``pre-commit`` by running:
187189

188190
.. code-block:: bash
@@ -197,6 +199,7 @@ Then, ensure that you install it as a ``Git hook`` by running:
197199

198200
Using ``pre-commit``
199201
~~~~~~~~~~~~~~~~~~~~
202+
200203
One installed as described, ``pre-commit`` automatically triggers every time
201204
that you try to commit a change. If any hook defined in `.pre-commit-config.yaml`
202205
fails, you must fix the failing files, stage the new changes, and try to commit
@@ -213,6 +216,7 @@ the hooks fail.
213216

214217
Tox
215218
---
219+
216220
You might consider using `tox`_ in your project. While this automation
217221
tool is similar to `Make`_, it supports testing of your package in a temporary
218222
virtual environment. Being able to test your package in isolation rather than in
@@ -221,7 +225,6 @@ virtual environment. Being able to test your package in isolation rather than in
221225
Configuration for `tox`_ is stored in a ``tox.ini`` file. The minimum
222226
configuration for a PyAnsys ``py<product>-<library>`` project should be:
223227

224-
225228
.. tab-set::
226229

227230
.. tab-item:: Tox with Flit
@@ -232,21 +235,20 @@ configuration for a PyAnsys ``py<product>-<library>`` project should be:
232235

233236
.. include:: code/tox-poetry.rst
234237

235-
236-
This minimum configuration assumes that you have a ``requirements/`` directory that
237-
contains ``requirements_tests.txt`` and ``requirements_doc.txt``. In
238+
This minimum configuration assumes that you have a ``requirements`` directory that
239+
contains ``requirements_tests.txt`` and ``requirements_doc.txt`` files. In
238240
addition, the ``style`` environment must execute ``pre-commit``, which guarantees
239241
the usage of this tool in your project.
240242

241243
Installing ``tox``
242244
~~~~~~~~~~~~~~~~~~
245+
243246
You can install ``tox`` like any other Python package:
244247

245248
.. code-block:: bash
246249

247250
python -m pip install tox
248251

249-
250252
Using ``tox``
251253
~~~~~~~~~~~~~
252254

@@ -262,10 +264,9 @@ It is possible to run multiple environments by separating them with commas ``tox
262264
-e <env-name0>,<env-name1>,...```. To run all available environments, simply
263265
run ``tox``.
264266

265-
266267
.. LINKS AND REFERENCES
267268

268-
.. _black: https://black.readthedocs.io/en/latest/
269+
.. _Black: https://black.readthedocs.io/en/latest/
269270
.. _isort: https://pycqa.github.io/isort/
270271
.. _flake8: https://flake8.pycqa.org/en/latest/
271272
.. _pre-commit: https://pre-commit.com/

doc/source/coding-style/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Coding style
2-
############
2+
============
3+
34
Coding style refers to the different rules defined in a software project that
45
must be followed when writing source code. These rules ensure that all
56
the source code looks the same across different files of the

0 commit comments

Comments
 (0)