Skip to content

General Coding Standards

Andrew Lee edited this page Apr 6, 2022 · 3 revisions

The following general standards apply to all IDAES Code:

  • All code in IDAES repositories must begin with the IDAES Copyright header.
  • Code should follow PEP-8 Style Guide: https://www.python.org/dev/peps/pep-0008/. black and pylint are used as part of the automated testing procedure and code must pass these test. Developers are strongly encouraged to use pylint or another linter when developing code and to run black before commiting.
  • Docstrings should use Google style formatting: https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html.
  • Commenting of code is strongly encouraged.
  • Class and variable names should be descriptive, and use of Pyomo docstrings on all components is encouraged. Aliases may be used within the code to shorten long names (fully-qualified names of IDAES components end up being very long), but these should generally be descriptive as well.
  • All code must be accompanied by documentation and tests. More details on the expectations for these is provided elsewhere in the testing standards.
Clone this wiki locally