bioscrape
bioscrape copied to clipboard
Add docstrings to classes and functions for automated documentation + Clarity
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.
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?
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.
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