MacroDensity icon indicating copy to clipboard operation
MacroDensity copied to clipboard

Clean up syntax

Open keeeto opened this issue 7 years ago • 2 comments

There are not many style rules observed in the code. It would be nice to tidy this up before a submission to JOSS.

ToDo: run the source code through and try to check for style conventions, imports of unused functions etc.

keeeto avatar Apr 12 '18 14:04 keeeto

There are lots of tools for using PEP8, which is the style I generally expect to see in a disciplined Python project. Most of PEP8 is great; the main contentious bit is the maximum linewidth of 79 characters, but that actually isn't a problem with the current Macrodensity codebase. The biggest change from the existing style is the consistent use of spaces after commas. The pep8 program is handy for finding inconsistencies and there's even yapf which will reformat for you. (Although I find it a bit too eager to split function arguments onto individual lines.)

ajjackson avatar Jun 06 '18 15:06 ajjackson

It's also worth noting that Google-style docstrings are already in somewhat-consistent use. If that's cleaned up and expanded a little it would be easy to get some fancy API docs using sphinx/Napoleon.

ajjackson avatar Jun 06 '18 15:06 ajjackson