Coding style#

Coding style refers to the different rules defined in a software project that must be followed when writing source code. These rules ensure that all the source code looks the same across different files of the project.

Because the PyAnsys ecosystem consists of many projects, coding style rules are critical to:

  1. Prevent against common programming errors

  2. Limit product complexity

  3. Provide an easily readable, understandable, and maintainable product

  4. Establish a consistent style

  5. Implement an objective basis for code review

All PyAnsys libraries are expected to follow PEP 8 and be consistent in style and formatting with the libraries for the ‘big three’ data science packages: numpy, scipy, and pandas.

The purpose of this section is not to repeat coding style documentation, but rather to describe coding best practices applicable to the PyAnsys project when there are any delineations, clarifications, or additional procedures above and beyond PEP 8. For example, this section provides a topic on deprecation best practices because there is no official guidance on deprecating features within Python.