This assignment is designed to help you refine your code documentation skills. It will look at various levels of documentation, including comments, docstrings and readmes.
For this assignment, submit one PR for Task 1 and a separate PR for Task 2. Some of your peers will be providing feedback for your readme in a future assignment.
Task 1 involves commenting and cleaning up some poorly written code.
look at task_1.py and test_task_1.py and try to understand what the
func
function and Thingy
class do. Then:
- Clean up the code by giving variables/functions descriptive names
- Add a few comments to make the "why" of the code more clear
- Add numpy style docstrings to
func
andThingy
. Be sure to include necessary sections and an example. Don't worry about commenting methods that start with double underscores. - Rename the test classes and cases in test_task_1.py to be more descriptive and add brief docstring descriptions.
After you finish, make sure the tests still pass.
This task gives you a chance to practice creative python writing. Create a readme.md file for a python package you wish existed (and potentially could with enough work, so nothing magical). You can use this example as a template. Make sure after looking at your readme for less than 1 minute a user knows what it does and what a basic code example looks like. Add some badges (perhaps from other projects so they work). Save this as MY_README.md in this repo.
Note: Writing high-level documentation before coding is known, among other names, as Documentation Driven Development and it is an effective way for designing nice APIs.