Skip to content

Writing code

Pavithra Rajeswaran edited this page Nov 11, 2021 · 2 revisions

In general, follow the PEP 8 style guidelines.

Function Checklist

  • All variables are consistent with the standard naming convention
  • Input and output arguments are in the proper order.
  • Header includes all required information from the template
  • Comments throughout the code fit the fulfilling the requirements

Consistent Variables

All variables (input args, output args, local variables) names and format should be standardized according to the standard convention.

https://docs.google.com/spreadsheets/d/1-zCbqKLzqmr3iDg494yDx2NqNXF254r9CA05bTEyeaM/edit#gid=0

Argument order

All input and output variables should maintain the following order:

  1. Data (arrays, file path strings)
  2. Function specifics
  3. Plotting information
  4. Save information

Data inputs are required and should not be keyworded. Function-specific, plotting and saving parameters should be keyworded with default values.

General Comments

Comments should be included whenever any of the following conditions are met:

  • New local variable is defined. (Include units if applicable)
  • Major analysis section
  • Plotting
  • Saving

Using new libraries

If you are using any new library that requires installation, then the new libraries need to be added to the 'install_requires' variable in setup.py and the 'autodoc_mock_imports' variable in docs/source/conf.py

Clone this wiki locally