Skip to content

Commit b35db6b

Browse files
authored
Fix various typos (#99)
1 parent 2731ee9 commit b35db6b

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

doc/source/coding-style/pep8.rst

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Import Location
2121
~~~~~~~~~~~~~~~
2222
Imports should always be placed at the top of the file, just after any
2323
module comments and docstrings and before module globals and
24-
constants. This reduces the likelihood of an `ImportError`_ that
24+
constants. This reduces the likelihood of an `ImportError`_ that
2525
might only be discovered during runtime.
2626

2727
.. _ImportError: https://docs.python.org/3/library/exceptions.html#ImportError
@@ -48,8 +48,8 @@ might only be discovered during runtime.
4848
return math.log(8, x)
4949
5050
51-
Imports Order
52-
~~~~~~~~~~~~~
51+
Import Order
52+
~~~~~~~~~~~~
5353
For better readability, group imports in this order:
5454

5555
#. Standard library imports
@@ -126,7 +126,7 @@ package.
126126
Import Namespaces
127127
~~~~~~~~~~~~~~~~~
128128
You should avoid using wildcards in imports because doing so can make it
129-
difficult to detect undefined names. For more information, see `Python
129+
difficult to detect undefined names. For more information, see `Python
130130
Anti-Patterns: using wildcard imports
131131
<(https://docs.quantifiedcode.com/python-anti-patterns/maintainability/from_module_import_all_used.html>`_.
132132

@@ -226,7 +226,7 @@ following conventions apply:
226226
"""This method should only be called from ``MyClass``.
227227
228228
Protected methods can be called from inherited classes,
229-
unlike private methods, which names are 'mangled' to avoid
229+
For private methods, which names are 'mangled' to prevent
230230
these methods from being called from inherited classes.
231231
232232
"""
@@ -274,7 +274,7 @@ Indentation should be used to emphasize:
274274

275275
- Body of a control statement, such as a loop or a select statement
276276
- Body of a conditional statement
277-
- New scope block
277+
- New scope blocks
278278

279279
.. code:: python
280280
@@ -287,7 +287,7 @@ Indentation should be used to emphasize:
287287
288288
289289
def top_level_function():
290-
"""Top level function docstring."""
290+
"""Top-level function docstring."""
291291
return
292292
293293
For improved readability, add blank lines or wrapping lines. Two
@@ -424,9 +424,8 @@ For example, the following comment is not needed:
424424
# increment the counter
425425
i += 1
426426
427-
However, an important portion of the behavior that is not self-apparent
428-
should include a note from the developer writing it. Otherwise,
429-
future developers may remove what they see as unnecessary.
427+
However, if code behavior is not self-apparent, it should be documented.
428+
Otherwise, future developers might remove code that they see as unnecessary.
430429

431430
.. code:: python
432431
@@ -502,9 +501,9 @@ For more information on docstrings for PyAnsys libraries, see
502501
Programming Recommendations
503502
---------------------------
504503
The following sections provide some `PEP8
505-
<https://www.python.org/dev/peps/pep-0008/>`_ suggestions for removing
506-
ambiguity and preserving consistency. They also address some common pitfalls
507-
when writing Python code.
504+
<https://www.python.org/dev/peps/pep-0008/>`_ recommendations for removing
505+
ambiguity and preserving consistency. Additionally, they address some common
506+
pitfalls that occur when writing Python code.
508507

509508

510509
Booleans and Comparisons
@@ -683,7 +682,7 @@ for this method.
683682
def test_fahr_to_kelvin():
684683
np.testing.assert_allclose(12.7778, fahr_to_kelvin(55))
685684
686-
Now, you have only one line of code to verify and can also use
685+
Now, you have only one line of code to verify. You can also use
687686
a testing framework such as ``pytest`` to test that the method is
688687
correct.
689688

@@ -759,7 +758,7 @@ to circumvent nested loops.
759758
760759
If the loop is too complicated for creating a list comprehension,
761760
consider creating small functions and calling these instead. For
762-
example to extract all consonants in a sentence:
761+
example, to extract all consonants in a sentence:
763762

764763
.. tabs::
765764

@@ -806,7 +805,7 @@ Security Considerations
806805
Security, an ongoing process involving people and practices, ensures application confidentiality, integrity, and availability [#]_.
807806
Any library should be secure and implement good practices that avoid or mitigate possible security risks.
808807
This is especially relevant in libraries that request user input (such as web services).
809-
Because security is a broad topic, we recommend you review this useful Python-specific resource:
808+
Because security is a broad topic, you should review this useful Python-specific resource:
810809

811810
* `10 Unknown Security Pitfalls for Python <https://blog.sonarsource.com/10-unknown-security-pitfalls-for-python>`_ - By Dennis Brinkrolf - Sonar source blog
812811

0 commit comments

Comments
 (0)