Skip to content

Use PEP8 for Python API, Python use case and Python notebooks #1149

Open
@akenmorris

Description

@akenmorris

I've noticed our Python API and use cases use a variety of different and inconsistent coding styles. Luckily Python, unlike C++, has a well defined standard coding style called PEP8 that many packages follow (e.g. scipy, numpy, etc).

https://www.python.org/dev/peps/pep-0008/

https://www.pythonlikeyoumeanit.com/Module5_OddsAndEnds/Writing_Good_Code.html

Some packages like SciPy even disallow non-PEP8 code:

https://docs.scipy.org/doc/scipy/reference/dev/contributor/pep8.html

If you use a python IDE like PyCharm, this is easy to enforce since it will point out all code that violates PEP8:

foo

There is also a tool, autopep8:

https://pypi.org/project/autopep8/0.8/

I'm sure there are others as well.

This is just my recommendation. Feel free to overrule my suggestion and close this issue.

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions