bioscrape icon indicating copy to clipboard operation
bioscrape copied to clipboard

Add docstrings to classes and functions for automated documentation + Clarity

Open ayush9pandey opened this issue 4 years ago • 3 comments

This could be a running issue where every developer can try to add docstrings to existing classes and functions. For new additions to the software, we should check every pull request for docstrings as well.

ayush9pandey avatar Jun 15 '20 17:06 ayush9pandey

Good idea - I think Zoltan was doing this for BioCRNpyler. If you can set this up and teach it to me, I can add doc-strings to all of bioscrape cython code (I'm guessing I'm the only person who knows it well enough to do that at this point). Ideally there is a way to get detailed information on which functions don't have doc-strings, right?

WilliamIX avatar Jun 15 '20 17:06 WilliamIX

Yeah, once we setup the automated documentation tool we should be able to see what functions don't have doc strings. For now, we can add docstrings whenever we find that they are missing.

ayush9pandey avatar Jun 16 '20 05:06 ayush9pandey

The answer is flake8!

pip install flake8

pip install flake8-docstrings

By default, flake8 checks the PEP8 compliance, but with the docstring extension, it can do more:

flake8 --select D bioscrape Filters for docstring errors (category D)

A way to automate: you can use a pre-commit hook, which runs after you execute the git commit command on your computer. Here's an example config

zoltuz avatar Jun 16 '20 15:06 zoltuz