@@ -23,7 +23,7 @@ Aside from pyansys specific directives, the best coding practice is to simply
23
23
follow established guidelines from `PEP8 <https://www.python.org/dev/peps/pep-0008/ >`__.
24
24
25
25
26
- Deprecation Best- Practice
26
+ Deprecation Best Practice
27
27
-------------------------
28
28
Whenever a method, class, or function is deprecated, we must provide
29
29
an old method that calls the new method and raises a warning, or raise
@@ -108,11 +108,11 @@ Then simply use that inplace of ``Exception``
108
108
"""
109
109
raise DeprecationError(' `my_function` has been deprecated' )
110
110
111
- Imports Best- Practice
111
+ Imports Best Practice
112
112
---------------------
113
113
114
114
Following the `PEP8 guidelines <https://www.python.org/dev/peps/pep-0008/#imports >`_,
115
- imports should be added at the top of the file and should be grouped in the following order:
115
+ imports should be added at the top of the file and should be grouped in this order:
116
116
117
117
1. Standard library imports.
118
118
2. Related third party imports.
@@ -136,7 +136,7 @@ For example, consider the unorganized imports below:
136
136
from ansys.mapdl.core.commands import Commands
137
137
from ansys.mapdl.core.inline_functions import Query
138
138
139
- Organizing those same imports into groups vastly improves readibilty:
139
+ Organizing these same imports into groups vastly improves readibilty:
140
140
141
141
.. code :: python
142
142
@@ -156,9 +156,9 @@ Organizing those same imports into groups vastly improves readibilty:
156
156
from ansys.mapdl.core.commands import Commands
157
157
from ansys.mapdl.core.inline_functions import Query
158
158
159
- It is also recommended that the imports within a section be organized alphabetically.
160
- Following this convention makes imports easily searchable. This standard is optional
161
- and will not be enforced, but it may be preferred in some projects.
159
+ We also recommend that the imports within a section be organized alphabetically.
160
+ Following this convention makes imports easily searchable. While this standard is optional,
161
+ it may be preferred in some projects.
162
162
163
163
.. code :: python
164
164
@@ -178,7 +178,7 @@ and will not be enforced, but it may be preferred in some projects.
178
178
from ansys.mapdl.core.plotting import general_plotter
179
179
from ansys.mapdl.core.post import PostProcessing
180
180
181
- Additionally, it is recommended to use absolute imports over relative imports, since they are
181
+ Additionally, we recommend to use absolute imports over relative imports because they are
182
182
more readable and reliable:
183
183
184
184
.. code :: python
@@ -201,7 +201,7 @@ method or feature is added, changed, or removed, the minor version
201
201
should be bumped.
202
202
203
203
To avoid constantly bumping the minor version, one approach to for
204
- source- control branching is to create release branches where only
204
+ source control branching is to create release branches where only
205
205
patch fixes are pushed to, and API changes occur between minor
206
206
releases. See `Trunk Based Development
207
207
<https://trunkbaseddevelopment.com/> `_. In summary, the mainline
@@ -218,7 +218,7 @@ update any projects dependent on the API while still being treated as
218
218
multiple "release branches" in a repository, the number of active
219
219
release branches should be between one and three.
220
220
221
- Docstring Examples Best- Practice
221
+ Docstring Examples Best Practice
222
222
--------------------------------
223
223
Defining docstring examples for methods and classes are extremely
224
224
useful. The examples give users an easy place to start when trying
@@ -228,7 +228,7 @@ also be used to perform regression testing to verify that the code is
228
228
executing as expected.
229
229
230
230
This is an important feature of maintainable documentation as examples
231
- must always match the API they are documenting, and any changes within
231
+ must always match the API that they are documenting. Any changes within
232
232
the API without a corresponding change in the documentation will
233
233
trigger doctest failures.
234
234
@@ -252,11 +252,11 @@ execute them to verify that they function as written.
252
252
Using ``pytest `` Fixtures
253
253
~~~~~~~~~~~~~~~~~~~~~~~~~
254
254
To define a setup sequence before the ``doctest `` run or before a given
255
- module is tested, ``pytest `` fixtures can be used. Fixtures allow docstring
256
- examples to access shared objects, so there is no need to repeat the setup
255
+ module is tested, you can use ``pytest `` fixtures. Because fixtures allow docstring
256
+ examples to access shared objects, there is no need to repeat the setup
257
257
in each example.
258
258
259
- ``pytest `` fixtures can defined in a ``conftest.py `` file next to the source
259
+ You can define ``pytest `` fixtures in a ``conftest.py `` file next to the source
260
260
code. The following example shows a fixture that is run automatically for
261
261
each ``doctest `` session.
262
262
@@ -276,7 +276,7 @@ each ``doctest`` session.
276
276
yield desktop
277
277
desktop.force_close_desktop()
278
278
279
- Fixtures can also be defined in a separate Python file from
279
+ You can also define fixtures in a separate Python file from
280
280
``conftest.py ``. This may help keep the fixtures more organized. Fixtures
281
281
from other files need to be imported in the main ``conftest.py `` file. The
282
282
following example shows how to import fixtures defined in an
@@ -345,7 +345,7 @@ example, by referencing the key ``icepak``.
345
345
Examples
346
346
--------
347
347
348
- Create an opening boundary for the faces of the " USB_GND" object.
348
+ Create an opening boundary for the faces of the `` USB_GND`` object.
349
349
350
350
>>> faces = icepak.modeler.primitives["USB_GND"].faces
351
351
>>> face_names = [face.id for face in faces]
@@ -358,7 +358,7 @@ example, by referencing the key ``icepak``.
358
358
Useful Features
359
359
~~~~~~~~~~~~~~~
360
360
361
- Ellipses For Random Output
361
+ Ellipses for Random Output
362
362
**************************
363
363
If the output of some operation in an example cannot be verified exactly,
364
364
an ellipsis (``... ``) can be used in the expected output. This allows it
0 commit comments